<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libconfini: confini.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libconfini
   </div>
   <div id="projectbrief">Yet another INI parser</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">confini.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>libconfini functions  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &quot;<a class="el" href="confini_8h_source.html">confini.h</a>&quot;</code><br />
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:aff2761409196287c45bb8876c8613aae"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#aff2761409196287c45bb8876c8613aae">CONFINI_IO_FLAVOR</a>&#160;&#160;&#160;CONFINI_STANDARD</td></tr>
<tr class="memdesc:aff2761409196287c45bb8876c8613aae"><td class="mdescLeft">&#160;</td><td class="mdescRight">The I/O API to use (possibly overridden via <code>-DCONFINI_IO_FLAVOR=[FLAVOR]</code>)  <a href="confini_8c.html#aff2761409196287c45bb8876c8613aae">More...</a><br /></td></tr>
<tr class="separator:aff2761409196287c45bb8876c8613aae"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a02b2b22a18125d04b08e553f23b110d4"><td class="memItemLeft" align="right" valign="top">static unsigned char&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a02b2b22a18125d04b08e553f23b110d4">is_some_space</a> (const char chr, const int_least8_t depth)</td></tr>
<tr class="memdesc:a02b2b22a18125d04b08e553f23b110d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether a character is a space.  <a href="confini_8c.html#a02b2b22a18125d04b08e553f23b110d4">More...</a><br /></td></tr>
<tr class="separator:a02b2b22a18125d04b08e553f23b110d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a053d51597242d83b250e6cd80498e15a"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a053d51597242d83b250e6cd80498e15a">ltrim_s</a> (const char *const str, const size_t offs, const int_least8_t depth)</td></tr>
<tr class="memdesc:a053d51597242d83b250e6cd80498e15a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Soft left trim &ndash; does not change the buffer.  <a href="confini_8c.html#a053d51597242d83b250e6cd80498e15a">More...</a><br /></td></tr>
<tr class="separator:a053d51597242d83b250e6cd80498e15a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad8ba35c611800a3e102a659d542cb1c2"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ad8ba35c611800a3e102a659d542cb1c2">ltrim_h</a> (char *const str, const size_t offs, const int_least8_t depth)</td></tr>
<tr class="memdesc:ad8ba35c611800a3e102a659d542cb1c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hard left trim &ndash; <b>does</b> change the buffer.  <a href="confini_8c.html#ad8ba35c611800a3e102a659d542cb1c2">More...</a><br /></td></tr>
<tr class="separator:ad8ba35c611800a3e102a659d542cb1c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8a1e0e57af2eb3365f5613b93f3fe65e"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a8a1e0e57af2eb3365f5613b93f3fe65e">ltrim_hh</a> (char *const str, const size_t offs, const int_least8_t depth)</td></tr>
<tr class="memdesc:a8a1e0e57af2eb3365f5613b93f3fe65e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shifting left trim &ndash; <b>does</b> change the buffer.  <a href="confini_8c.html#a8a1e0e57af2eb3365f5613b93f3fe65e">More...</a><br /></td></tr>
<tr class="separator:a8a1e0e57af2eb3365f5613b93f3fe65e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f46f169f1e23941ed31f6d0247881f8"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a9f46f169f1e23941ed31f6d0247881f8">rtrim_s</a> (const char *const str, const size_t len, const int_least8_t depth)</td></tr>
<tr class="memdesc:a9f46f169f1e23941ed31f6d0247881f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Soft right trim &ndash; does not change the buffer.  <a href="confini_8c.html#a9f46f169f1e23941ed31f6d0247881f8">More...</a><br /></td></tr>
<tr class="separator:a9f46f169f1e23941ed31f6d0247881f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4fd4ce066c199b7dab8849c3f5ab3344"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a4fd4ce066c199b7dab8849c3f5ab3344">rtrim_h</a> (char *const str, const size_t len, const int_least8_t depth)</td></tr>
<tr class="memdesc:a4fd4ce066c199b7dab8849c3f5ab3344"><td class="mdescLeft">&#160;</td><td class="mdescRight">Hard right trim &ndash; <b>does</b> change the buffer.  <a href="confini_8c.html#a4fd4ce066c199b7dab8849c3f5ab3344">More...</a><br /></td></tr>
<tr class="separator:a4fd4ce066c199b7dab8849c3f5ab3344"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae763c8d7fa3afbb34e20172e1defc05f"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ae763c8d7fa3afbb34e20172e1defc05f">urtrim_s</a> (const char *const str, const size_t len)</td></tr>
<tr class="memdesc:ae763c8d7fa3afbb34e20172e1defc05f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unparsed soft right trim (right trim of <code>/(?:\s|\\[\n\r])+$/</code>) &ndash; does not change the buffer.  <a href="confini_8c.html#ae763c8d7fa3afbb34e20172e1defc05f">More...</a><br /></td></tr>
<tr class="separator:ae763c8d7fa3afbb34e20172e1defc05f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6e6972b13052e995b3ceb2fb4996ede"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ad6e6972b13052e995b3ceb2fb4996ede">string_tolower</a> (char *const str)</td></tr>
<tr class="memdesc:ad6e6972b13052e995b3ceb2fb4996ede"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert an ASCII string to lower case.  <a href="confini_8c.html#ad6e6972b13052e995b3ceb2fb4996ede">More...</a><br /></td></tr>
<tr class="separator:ad6e6972b13052e995b3ceb2fb4996ede"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc2039866ca1e79344d7da6ef06ddf87"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#adc2039866ca1e79344d7da6ef06ddf87">qultrim_h</a> (char *const srcstr, const size_t offs, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:adc2039866ca1e79344d7da6ef06ddf87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unparsed hard left trim (left trim of <code>/^(?:\s+|\\[\n\r]|''|&quot;&quot;)+/</code>) &ndash; <b>does</b> change the buffer.  <a href="confini_8c.html#adc2039866ca1e79344d7da6ef06ddf87">More...</a><br /></td></tr>
<tr class="separator:adc2039866ca1e79344d7da6ef06ddf87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac2aa1c0316cc78e3f878e1ea644b48f8"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ac2aa1c0316cc78e3f878e1ea644b48f8">dqultrim_s</a> (const char *const srcstr, const size_t offs, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:ac2aa1c0316cc78e3f878e1ea644b48f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Soft left trim within an unparsed disabled entry (left trim of <code>/(?:(?:^|\\?[\n\r])[ \t\v\f]*(?:#(?:[ \t\v\f]|''|&quot;&quot;)*)?)+/</code>) &ndash; does not change the buffer.  <a href="confini_8c.html#ac2aa1c0316cc78e3f878e1ea644b48f8">More...</a><br /></td></tr>
<tr class="separator:ac2aa1c0316cc78e3f878e1ea644b48f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab34de4f3cd8ff30c45ac7652457f695e"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ab34de4f3cd8ff30c45ac7652457f695e">getn_metachar_pos</a> (const char *const str, const char chr, const size_t len, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:ab34de4f3cd8ff30c45ac7652457f695e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the position of the first occurrence out of quotes of a given character, stopping after a given number of charcters.  <a href="confini_8c.html#ab34de4f3cd8ff30c45ac7652457f695e">More...</a><br /></td></tr>
<tr class="separator:ab34de4f3cd8ff30c45ac7652457f695e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a93c4d8e9287f6ce56f22ce90241b77f4"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a93c4d8e9287f6ce56f22ce90241b77f4">get_metachar_pos</a> (const char *const str, const char chr, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a93c4d8e9287f6ce56f22ce90241b77f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the position of the first occurrence out of quotes of a given character.  <a href="confini_8c.html#a93c4d8e9287f6ce56f22ce90241b77f4">More...</a><br /></td></tr>
<tr class="separator:a93c4d8e9287f6ce56f22ce90241b77f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa139c7fd80a4a707683a45d16f527a60"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#aa139c7fd80a4a707683a45d16f527a60">unescape_cr_lf</a> (char *const srcstr, const size_t len, const unsigned char is_disabled, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:aa139c7fd80a4a707683a45d16f527a60"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replace <code>/\\(\n\r?|\r\n?)[\t \v\f]*[#;]/</code> or <code>/\\(\n\r?|\r\n?)/</code> with <code>"$1"</code>  <a href="confini_8c.html#aa139c7fd80a4a707683a45d16f527a60">More...</a><br /></td></tr>
<tr class="separator:aa139c7fd80a4a707683a45d16f527a60"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa17889754780149f18e417607e5ffb24"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#aa17889754780149f18e417607e5ffb24">sanitize_section_path</a> (char *const secpath, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:aa17889754780149f18e417607e5ffb24"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sanitize a section path.  <a href="confini_8c.html#aa17889754780149f18e417607e5ffb24">More...</a><br /></td></tr>
<tr class="separator:aa17889754780149f18e417607e5ffb24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0ab1c9f49e30ee6f637c213a27738d21"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a0ab1c9f49e30ee6f637c213a27738d21">collapse_everything</a> (char *const ini_string, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a0ab1c9f49e30ee6f637c213a27738d21"><td class="mdescLeft">&#160;</td><td class="mdescRight">Out of quotes similar to ECMAScript <code>ini_string.replace(/''|&quot;&quot;/g, "").replace(/^[\n\r]\s*|\s+/g, " ")</code>  <a href="confini_8c.html#a0ab1c9f49e30ee6f637c213a27738d21">More...</a><br /></td></tr>
<tr class="separator:a0ab1c9f49e30ee6f637c213a27738d21"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ace46ed55f0c50e6314cb4610c536ab"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a6ace46ed55f0c50e6314cb4610c536ab">collapse_spaces</a> (char *const ini_string, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a6ace46ed55f0c50e6314cb4610c536ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Out of quotes similar to ECMAScript <code>ini_string.replace(/\s+/g, " ")</code>  <a href="confini_8c.html#a6ace46ed55f0c50e6314cb4610c536ab">More...</a><br /></td></tr>
<tr class="separator:a6ace46ed55f0c50e6314cb4610c536ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6dfd90309965c426ac9b072d79a08601"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a6dfd90309965c426ac9b072d79a08601">collapse_empty_quotes</a> (char *const str, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a6dfd90309965c426ac9b072d79a08601"><td class="mdescLeft">&#160;</td><td class="mdescRight">Similar to ECMAScript <code>str.replace(/''|&quot;&quot;/g, "")</code>  <a href="confini_8c.html#a6dfd90309965c426ac9b072d79a08601">More...</a><br /></td></tr>
<tr class="separator:a6dfd90309965c426ac9b072d79a08601"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2abf4acb5b68e6c6930e63ecc754bbe"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ad2abf4acb5b68e6c6930e63ecc754bbe">uncomment</a> (char *const srcstr, size_t len, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:ad2abf4acb5b68e6c6930e63ecc754bbe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove all comment initializers (<code>#</code> and/or <code>;</code>) from the beginning of each line of a comment.  <a href="confini_8c.html#ad2abf4acb5b68e6c6930e63ecc754bbe">More...</a><br /></td></tr>
<tr class="separator:ad2abf4acb5b68e6c6930e63ecc754bbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9066042710533c59fa9087dccd842c5a"><td class="memItemLeft" align="right" valign="top">static uint_least8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a9066042710533c59fa9087dccd842c5a">get_type_as_active</a> (const char *const srcstr, const size_t len, const unsigned char allow_implicit, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a9066042710533c59fa9087dccd842c5a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to determine the type of a member <b>assuming it is active</b>  <a href="confini_8c.html#a9066042710533c59fa9087dccd842c5a">More...</a><br /></td></tr>
<tr class="separator:a9066042710533c59fa9087dccd842c5a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a28e12cde8688ade4d85ea5d8b0db31d3"><td class="memItemLeft" align="right" valign="top">static size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a28e12cde8688ade4d85ea5d8b0db31d3">further_cuts</a> (char *const srcstr, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a28e12cde8688ade4d85ea5d8b0db31d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Examine a (single-/multi-line) segment and check whether it contains more than just one node.  <a href="confini_8c.html#a28e12cde8688ade4d85ea5d8b0db31d3">More...</a><br /></td></tr>
<tr class="separator:a28e12cde8688ade4d85ea5d8b0db31d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a25d648d387f6e8bc36e7965accfca63b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a25d648d387f6e8bc36e7965accfca63b">strip_ini_cache</a> (register char *const ini_source, const size_t ini_length, const <a class="el" href="structIniFormat.html">IniFormat</a> format, const <a class="el" href="confini_8h.html#a3330e1083693c66b63b18c0d8883f9a8">IniStatsHandler</a> f_init, const <a class="el" href="confini_8h.html#a0eff1cb87db5b73071e87f8cc9c4b445">IniDispHandler</a> f_foreach, void *const user_data)</td></tr>
<tr class="memdesc:a25d648d387f6e8bc36e7965accfca63b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback.  <a href="confini_8c.html#a25d648d387f6e8bc36e7965accfca63b">More...</a><br /></td></tr>
<tr class="separator:a25d648d387f6e8bc36e7965accfca63b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7d5042d3044dfb5a34a6bfc5af3a882d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a7d5042d3044dfb5a34a6bfc5af3a882d">load_ini_file</a> (FILE *const ini_file, const <a class="el" href="structIniFormat.html">IniFormat</a> format, const <a class="el" href="confini_8h.html#a3330e1083693c66b63b18c0d8883f9a8">IniStatsHandler</a> f_init, const <a class="el" href="confini_8h.html#a0eff1cb87db5b73071e87f8cc9c4b445">IniDispHandler</a> f_foreach, void *const user_data)</td></tr>
<tr class="memdesc:a7d5042d3044dfb5a34a6bfc5af3a882d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse an INI file and dispatch its content to a custom callback using a <code>FILE</code> structure as argument.  <a href="confini_8c.html#a7d5042d3044dfb5a34a6bfc5af3a882d">More...</a><br /></td></tr>
<tr class="separator:a7d5042d3044dfb5a34a6bfc5af3a882d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a54be108d26619db3066ce1c000dc8a17"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a> (const char *const path, const <a class="el" href="structIniFormat.html">IniFormat</a> format, const <a class="el" href="confini_8h.html#a3330e1083693c66b63b18c0d8883f9a8">IniStatsHandler</a> f_init, const <a class="el" href="confini_8h.html#a0eff1cb87db5b73071e87f8cc9c4b445">IniDispHandler</a> f_foreach, void *const user_data)</td></tr>
<tr class="memdesc:a54be108d26619db3066ce1c000dc8a17"><td class="mdescLeft">&#160;</td><td class="mdescRight">Parse an INI file and dispatch its content to a custom callback using a path as argument.  <a href="confini_8c.html#a54be108d26619db3066ce1c000dc8a17">More...</a><br /></td></tr>
<tr class="separator:a54be108d26619db3066ce1c000dc8a17"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bb35677b6e7c201eb1fe83efee99d9a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a8bb35677b6e7c201eb1fe83efee99d9a">ini_string_match_ss</a> (const char *const simple_string_a, const char *const simple_string_b, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a8bb35677b6e7c201eb1fe83efee99d9a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two simple strings and check whether they match.  <a href="confini_8c.html#a8bb35677b6e7c201eb1fe83efee99d9a">More...</a><br /></td></tr>
<tr class="separator:a8bb35677b6e7c201eb1fe83efee99d9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5773ae8cbe4ce15737dcece84b362fa0"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a5773ae8cbe4ce15737dcece84b362fa0">ini_string_match_si</a> (const char *const simple_string, const char *const ini_string, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a5773ae8cbe4ce15737dcece84b362fa0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare a simple string and an INI string and and check whether they match.  <a href="confini_8c.html#a5773ae8cbe4ce15737dcece84b362fa0">More...</a><br /></td></tr>
<tr class="separator:a5773ae8cbe4ce15737dcece84b362fa0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a731857502fa7f8e31c4a024335a6d5d6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a731857502fa7f8e31c4a024335a6d5d6">ini_string_match_ii</a> (const char *const ini_string_a, const char *const ini_string_b, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a731857502fa7f8e31c4a024335a6d5d6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two INI strings and check whether they match.  <a href="confini_8c.html#a731857502fa7f8e31c4a024335a6d5d6">More...</a><br /></td></tr>
<tr class="separator:a731857502fa7f8e31c4a024335a6d5d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a76a050b341e311cc9bbb79b399691e12"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a76a050b341e311cc9bbb79b399691e12">ini_array_match</a> (const char *const ini_string_a, const char *const ini_string_b, const char delimiter, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a76a050b341e311cc9bbb79b399691e12"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compare two INI arrays and check whether they match.  <a href="confini_8c.html#a76a050b341e311cc9bbb79b399691e12">More...</a><br /></td></tr>
<tr class="separator:a76a050b341e311cc9bbb79b399691e12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac55f3fab95f697ac5058533df100fc11"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ac55f3fab95f697ac5058533df100fc11">ini_unquote</a> (char *const ini_string, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:ac55f3fab95f697ac5058533df100fc11"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unescape <code>\'</code>, <code>\&quot;</code>, and <code>\\</code> and remove all unescaped quotes (when single/double quotes are considered metacharacters in respect to the format given)  <a href="confini_8c.html#ac55f3fab95f697ac5058533df100fc11">More...</a><br /></td></tr>
<tr class="separator:ac55f3fab95f697ac5058533df100fc11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4e3d48f0eb0438ba0c84fc77e362aa3"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a> (char *const ini_string, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:ab4e3d48f0eb0438ba0c84fc77e362aa3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unescape <code>\'</code>, <code>\&quot;</code>, and <code>\\</code> and remove all unescaped quotes (when single/double quotes are considered metacharacters in respect to the format given); if the format allows it, sequences of one or more spaces out of quotes will be collapsed.  <a href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">More...</a><br /></td></tr>
<tr class="separator:ab4e3d48f0eb0438ba0c84fc77e362aa3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a312803fa24be2d7f164f3041fbfa6865"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a312803fa24be2d7f164f3041fbfa6865">ini_array_get_length</a> (const char *const ini_string, const char delimiter, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a312803fa24be2d7f164f3041fbfa6865"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the length of a stringified INI array in number of members.  <a href="confini_8c.html#a312803fa24be2d7f164f3041fbfa6865">More...</a><br /></td></tr>
<tr class="separator:a312803fa24be2d7f164f3041fbfa6865"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a414c3b92adf45dbb966df1606b71ccdf"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a414c3b92adf45dbb966df1606b71ccdf">ini_array_foreach</a> (const char *const ini_string, const char delimiter, const <a class="el" href="structIniFormat.html">IniFormat</a> format, const <a class="el" href="confini_8h.html#a9cb562c563beb848850cc429a0a022ac">IniSubstrHandler</a> f_foreach, void *const user_data)</td></tr>
<tr class="memdesc:a414c3b92adf45dbb966df1606b71ccdf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Call a custom function for each member of a stringified INI array, without modifying the content of the buffer &ndash; useful for read-only (<code>const</code>) stringified arrays.  <a href="confini_8c.html#a414c3b92adf45dbb966df1606b71ccdf">More...</a><br /></td></tr>
<tr class="separator:a414c3b92adf45dbb966df1606b71ccdf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ca567ad863caef4609f8def7de0401a"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a6ca567ad863caef4609f8def7de0401a">ini_array_shift</a> (const char **const ini_strptr, const char delimiter, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a6ca567ad863caef4609f8def7de0401a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shift the location pointed by <code>ini_strptr</code> to the next member of the INI array (without modifying the content of the buffer), or to <code>NULL</code> if the INI array has no more members &ndash; useful for read-only (<code>const</code>) stringified arrays.  <a href="confini_8c.html#a6ca567ad863caef4609f8def7de0401a">More...</a><br /></td></tr>
<tr class="separator:a6ca567ad863caef4609f8def7de0401a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0721fcae5f04e5a9edd485dc1ddd2fa"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#aa0721fcae5f04e5a9edd485dc1ddd2fa">ini_array_collapse</a> (char *const ini_string, const char delimiter, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:aa0721fcae5f04e5a9edd485dc1ddd2fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compress the distribution of the data in a stringified INI array by removing all the white spaces that surround its delimiters, empty quotes, collapsable spaces, etc.  <a href="confini_8c.html#aa0721fcae5f04e5a9edd485dc1ddd2fa">More...</a><br /></td></tr>
<tr class="separator:aa0721fcae5f04e5a9edd485dc1ddd2fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a75809c0e952d9f9e14333e085ba6b910"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a75809c0e952d9f9e14333e085ba6b910">ini_array_break</a> (char *const ini_string, const char delimiter, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a75809c0e952d9f9e14333e085ba6b910"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replace the first delimiter found (together with the spaces that surround it) with <code>\0</code>  <a href="confini_8c.html#a75809c0e952d9f9e14333e085ba6b910">More...</a><br /></td></tr>
<tr class="separator:a75809c0e952d9f9e14333e085ba6b910"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2b34dc032fc37dda829dadf80bf34d26"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a2b34dc032fc37dda829dadf80bf34d26">ini_array_release</a> (char **const ini_strptr, const char delimiter, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a2b34dc032fc37dda829dadf80bf34d26"><td class="mdescLeft">&#160;</td><td class="mdescRight">Replace the first delimiter found (together with the spaces that surround it) with <code>\0</code>, then shifts the location pointed by <code>ini_strptr</code> to the next member of the INI array, or to <code>NULL</code> if the INI array has no more members.  <a href="confini_8c.html#a2b34dc032fc37dda829dadf80bf34d26">More...</a><br /></td></tr>
<tr class="separator:a2b34dc032fc37dda829dadf80bf34d26"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a04acd6a01a6a78810e7aab8e02923218"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a04acd6a01a6a78810e7aab8e02923218">ini_array_split</a> (char *const ini_string, const char delimiter, const <a class="el" href="structIniFormat.html">IniFormat</a> format, const <a class="el" href="confini_8h.html#aecbba63912eba3f61427599e719ffd7b">IniStrHandler</a> f_foreach, void *const user_data)</td></tr>
<tr class="memdesc:a04acd6a01a6a78810e7aab8e02923218"><td class="mdescLeft">&#160;</td><td class="mdescRight">Split a stringified INI array into NUL-separated members and call a custom function for each member.  <a href="confini_8c.html#a04acd6a01a6a78810e7aab8e02923218">More...</a><br /></td></tr>
<tr class="separator:a04acd6a01a6a78810e7aab8e02923218"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2d22fde4b4093871bcc498c2bddc7fbe"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a2d22fde4b4093871bcc498c2bddc7fbe">ini_global_set_lowercase_mode</a> (const bool lowercase)</td></tr>
<tr class="memdesc:a2d22fde4b4093871bcc498c2bddc7fbe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the value of the global variable <a class="el" href="confini_8c.html#a44d7de5e7bb75d40d31832a82b66891d" title="If set to true, key and section names in case-insensitive INI formats will be dispatched lowercase,...">INI_GLOBAL_LOWERCASE_MODE</a>.  <a href="confini_8c.html#a2d22fde4b4093871bcc498c2bddc7fbe">More...</a><br /></td></tr>
<tr class="separator:a2d22fde4b4093871bcc498c2bddc7fbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3a6eb3b79a88304864341075240ee412"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a3a6eb3b79a88304864341075240ee412">ini_global_set_implicit_value</a> (char *const implicit_value, const size_t implicit_v_len)</td></tr>
<tr class="memdesc:a3a6eb3b79a88304864341075240ee412"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the value to be to be assigned to implicit keys.  <a href="confini_8c.html#a3a6eb3b79a88304864341075240ee412">More...</a><br /></td></tr>
<tr class="separator:a3a6eb3b79a88304864341075240ee412"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a02bf5a1299ffb85fbd2f087cffbc1db8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="confini_8h.html#a47a6a31dd11db39ac287147955733511">IniFormatNum</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a02bf5a1299ffb85fbd2f087cffbc1db8">ini_fton</a> (const <a class="el" href="structIniFormat.html">IniFormat</a> source)</td></tr>
<tr class="memdesc:a02bf5a1299ffb85fbd2f087cffbc1db8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Calculate the <a class="el" href="confini_8h.html#a47a6a31dd11db39ac287147955733511" title="The unique ID of an INI format (24-bit maximum)">IniFormatNum</a> of an <a class="el" href="structIniFormat.html" title="24-bit bitfield representing the format of an INI file (INI dialect)">IniFormat</a>.  <a href="confini_8c.html#a02bf5a1299ffb85fbd2f087cffbc1db8">More...</a><br /></td></tr>
<tr class="separator:a02bf5a1299ffb85fbd2f087cffbc1db8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab4f3def0b84486ca2154673f339763fa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ab4f3def0b84486ca2154673f339763fa">ini_ntof</a> (const <a class="el" href="confini_8h.html#a47a6a31dd11db39ac287147955733511">IniFormatNum</a> format_num)</td></tr>
<tr class="memdesc:ab4f3def0b84486ca2154673f339763fa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a new <a class="el" href="structIniFormat.html" title="24-bit bitfield representing the format of an INI file (INI dialect)">IniFormat</a> according to an <a class="el" href="confini_8h.html#a47a6a31dd11db39ac287147955733511" title="The unique ID of an INI format (24-bit maximum)">IniFormatNum</a>.  <a href="confini_8c.html#ab4f3def0b84486ca2154673f339763fa">More...</a><br /></td></tr>
<tr class="separator:ab4f3def0b84486ca2154673f339763fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac43249a99e97f1d669a80c22a3e42564"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ac43249a99e97f1d669a80c22a3e42564">ini_get_bool</a> (const char *const simple_string, const int when_fail)</td></tr>
<tr class="memdesc:ac43249a99e97f1d669a80c22a3e42564"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether a simple string matches one of the booleans listed in the private constant <a class="el" href="confini_8c.html#afdb9fd02d693536253da07f0f468aaef" title="A list of possible string representations of boolean pairs.">INI_BOOLEANS</a> (case-insensitive)  <a href="confini_8c.html#ac43249a99e97f1d669a80c22a3e42564">More...</a><br /></td></tr>
<tr class="separator:ac43249a99e97f1d669a80c22a3e42564"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5d3460168636cfdffc6fb76be7c9b6b3"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a5d3460168636cfdffc6fb76be7c9b6b3">ini_get_bool_i</a> (const char *const ini_string, const int when_fail, const <a class="el" href="structIniFormat.html">IniFormat</a> format)</td></tr>
<tr class="memdesc:a5d3460168636cfdffc6fb76be7c9b6b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check whether an INI string matches one of the booleans listed in the private constant <a class="el" href="confini_8c.html#afdb9fd02d693536253da07f0f468aaef" title="A list of possible string representations of boolean pairs.">INI_BOOLEANS</a> (case-insensitive)  <a href="confini_8c.html#a5d3460168636cfdffc6fb76be7c9b6b3">More...</a><br /></td></tr>
<tr class="separator:a5d3460168636cfdffc6fb76be7c9b6b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:afdb9fd02d693536253da07f0f468aaef"><td class="memItemLeft" align="right" valign="top">static const char *const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#afdb9fd02d693536253da07f0f468aaef">INI_BOOLEANS</a> [][2]</td></tr>
<tr class="memdesc:afdb9fd02d693536253da07f0f468aaef"><td class="mdescLeft">&#160;</td><td class="mdescRight">A list of possible string representations of boolean pairs.  <a href="confini_8c.html#afdb9fd02d693536253da07f0f468aaef">More...</a><br /></td></tr>
<tr class="separator:afdb9fd02d693536253da07f0f468aaef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5b6bebfc01f8b23f69a2a2e602e91521"><td class="memItemLeft" align="right" valign="top">int(*const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a5b6bebfc01f8b23f69a2a2e602e91521">ini_get_int</a> )(const char *ini_string) = atoi</td></tr>
<tr class="memdesc:a5b6bebfc01f8b23f69a2a2e602e91521"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a href="http://www.gnu.org/software/libc/manual/html_node/Parsing-of-Integers.html#index-atoi"><code>atoi()</code></a>  <a href="confini_8c.html#a5b6bebfc01f8b23f69a2a2e602e91521">More...</a><br /></td></tr>
<tr class="separator:a5b6bebfc01f8b23f69a2a2e602e91521"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a05042d2551ab1c9402ab7223547c0777"><td class="memItemLeft" align="right" valign="top">long int(*const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a05042d2551ab1c9402ab7223547c0777">ini_get_lint</a> )(const char *ini_string) = atol</td></tr>
<tr class="memdesc:a05042d2551ab1c9402ab7223547c0777"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a href="http://www.gnu.org/software/libc/manual/html_node/Parsing-of-Integers.html#index-atol"><code>atol()</code></a>  <a href="confini_8c.html#a05042d2551ab1c9402ab7223547c0777">More...</a><br /></td></tr>
<tr class="separator:a05042d2551ab1c9402ab7223547c0777"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf3640e3632b10bf8dd2e852a7d82630"><td class="memItemLeft" align="right" valign="top">long long int(*const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#aaf3640e3632b10bf8dd2e852a7d82630">ini_get_llint</a> )(const char *ini_string) = atoll</td></tr>
<tr class="memdesc:aaf3640e3632b10bf8dd2e852a7d82630"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a href="http://www.gnu.org/software/libc/manual/html_node/Parsing-of-Integers.html#index-atoll"><code>atoll()</code></a>  <a href="confini_8c.html#aaf3640e3632b10bf8dd2e852a7d82630">More...</a><br /></td></tr>
<tr class="separator:aaf3640e3632b10bf8dd2e852a7d82630"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7aafdf3e7becda36ebe4e20f0f7438d"><td class="memItemLeft" align="right" valign="top">double(*const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#ac7aafdf3e7becda36ebe4e20f0f7438d">ini_get_double</a> )(const char *ini_string) = atof</td></tr>
<tr class="memdesc:ac7aafdf3e7becda36ebe4e20f0f7438d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pointer to <a href="http://www.gnu.org/software/libc/manual/html_node/Parsing-of-Integers.html#index-atof"><code>atof()</code></a>  <a href="confini_8c.html#ac7aafdf3e7becda36ebe4e20f0f7438d">More...</a><br /></td></tr>
<tr class="separator:ac7aafdf3e7becda36ebe4e20f0f7438d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a178704d02ede6101f757bbd37e5bd697"><td class="memItemLeft" align="right" valign="top">double(*const&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a178704d02ede6101f757bbd37e5bd697">ini_get_float</a> )(const char *ini_string) = atof</td></tr>
<tr class="memdesc:a178704d02ede6101f757bbd37e5bd697"><td class="mdescLeft">&#160;</td><td class="mdescRight">Legacy support for parsing a <code>double</code> data type &ndash; please <em>do not use this function</em>: use <code><a class="el" href="confini_8c.html#ac7aafdf3e7becda36ebe4e20f0f7438d" title="Pointer to atof()">ini_get_double()</a></code> instead.  <a href="confini_8c.html#a178704d02ede6101f757bbd37e5bd697">More...</a><br /></td></tr>
<tr class="separator:a178704d02ede6101f757bbd37e5bd697"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a44d7de5e7bb75d40d31832a82b66891d"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a44d7de5e7bb75d40d31832a82b66891d">INI_GLOBAL_LOWERCASE_MODE</a> = 0</td></tr>
<tr class="memdesc:a44d7de5e7bb75d40d31832a82b66891d"><td class="mdescLeft">&#160;</td><td class="mdescRight">If set to <code>true</code>, key and section names in case-insensitive INI formats will be dispatched lowercase, verbatim otherwise (default value: <code>false</code>)  <a href="confini_8c.html#a44d7de5e7bb75d40d31832a82b66891d">More...</a><br /></td></tr>
<tr class="separator:a44d7de5e7bb75d40d31832a82b66891d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a243b229193f154746a9fbfbdb02689bf"><td class="memItemLeft" align="right" valign="top">char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf">INI_GLOBAL_IMPLICIT_VALUE</a> = (char *) 0</td></tr>
<tr class="memdesc:a243b229193f154746a9fbfbdb02689bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Value to be assigned to implicit keys (default value: <code>NULL</code>)  <a href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf">More...</a><br /></td></tr>
<tr class="separator:a243b229193f154746a9fbfbdb02689bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acecf086ca074b27365e877f056af2192"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="confini_8c.html#acecf086ca074b27365e877f056af2192">INI_GLOBAL_IMPLICIT_V_LEN</a> = 0</td></tr>
<tr class="memdesc:acecf086ca074b27365e877f056af2192"><td class="mdescLeft">&#160;</td><td class="mdescRight">Length of the value assigned to implicit keys (default value: <code>0</code>)  <a href="confini_8c.html#acecf086ca074b27365e877f056af2192">More...</a><br /></td></tr>
<tr class="separator:acecf086ca074b27365e877f056af2192"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>libconfini functions </p>
<dl class="section author"><dt>Author</dt><dd>Stefano Gioffr&eacute; </dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>GNU General Public License, version 3 or any later version </dd></dl>
<dl class="section version"><dt>Version</dt><dd>1.16.4 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2016-2022 </dd></dl>
<dl class="section see"><dt>See also</dt><dd><a href="https://madmurphy.github.io/libconfini">https://madmurphy.github.io/libconfini</a> </dd></dl>
</div><h2 class="groupheader">Macro Definition Documentation</h2>
<a id="aff2761409196287c45bb8876c8613aae"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aff2761409196287c45bb8876c8613aae">&#9670;&nbsp;</a></span>CONFINI_IO_FLAVOR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define CONFINI_IO_FLAVOR&#160;&#160;&#160;CONFINI_STANDARD</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The I/O API to use (possibly overridden via <code>-DCONFINI_IO_FLAVOR=[FLAVOR]</code>) </p>
<p>Possible values are <code>CONFINI_STANDARD</code> and <code>CONFINI_POSIX</code> </p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a6dfd90309965c426ac9b072d79a08601"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6dfd90309965c426ac9b072d79a08601">&#9670;&nbsp;</a></span>collapse_empty_quotes()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t collapse_empty_quotes </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Similar to ECMAScript <code>str.replace(/''|&quot;&quot;/g, "")</code> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The string to collapse </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string </dd></dl>

</div>
</div>
<a id="a0ab1c9f49e30ee6f637c213a27738d21"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0ab1c9f49e30ee6f637c213a27738d21">&#9670;&nbsp;</a></span>collapse_everything()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t collapse_everything </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Out of quotes similar to ECMAScript <code>ini_string.replace(/''|&quot;&quot;/g, "").replace(/^[\n\r]\s*|\s+/g, " ")</code> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The string to collapse &ndash; multi-line escape sequences must be already unescaped at this stage </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string </dd></dl>

</div>
</div>
<a id="a6ace46ed55f0c50e6314cb4610c536ab"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ace46ed55f0c50e6314cb4610c536ab">&#9670;&nbsp;</a></span>collapse_spaces()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t collapse_spaces </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Out of quotes similar to ECMAScript <code>ini_string.replace(/\s+/g, " ")</code> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The string to collapse &ndash; multi-line escape sequences must be already unescaped at this stage </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string </dd></dl>

</div>
</div>
<a id="ac2aa1c0316cc78e3f878e1ea644b48f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac2aa1c0316cc78e3f878e1ea644b48f8">&#9670;&nbsp;</a></span>dqultrim_s()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t dqultrim_s </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>srcstr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>offs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Soft left trim within an unparsed disabled entry (left trim of <code>/(?:(?:^|\\?[\n\r])[ \t\v\f]*(?:#(?:[ \t\v\f]|''|&quot;&quot;)*)?)+/</code>) &ndash; does not change the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">srcstr</td><td>The target string (it may contain multi-line escape sequences) </td></tr>
    <tr><td class="paramname">offs</td><td>The offset where to start the left trim </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The offset of the first non-trivial character </dd></dl>

</div>
</div>
<a id="a28e12cde8688ade4d85ea5d8b0db31d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a28e12cde8688ade4d85ea5d8b0db31d3">&#9670;&nbsp;</a></span>further_cuts()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t further_cuts </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>srcstr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Examine a (single-/multi-line) segment and check whether it contains more than just one node. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">srcstr</td><td>Segment to examine (it may contain multi-line escape sequences) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Number of entries found </dd></dl>

</div>
</div>
<a id="a93c4d8e9287f6ce56f22ce90241b77f4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93c4d8e9287f6ce56f22ce90241b77f4">&#9670;&nbsp;</a></span>get_metachar_pos()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t get_metachar_pos </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>chr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the position of the first occurrence out of quotes of a given character. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The string where to search </td></tr>
    <tr><td class="paramname">chr</td><td>The character to to search </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The offset of the first occurrence of <code>chr</code> or the length of <code>str</code> if <code>chr</code> has not been not found </dd></dl>

</div>
</div>
<a id="a9066042710533c59fa9087dccd842c5a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9066042710533c59fa9087dccd842c5a">&#9670;&nbsp;</a></span>get_type_as_active()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static uint_least8_t get_type_as_active </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>srcstr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char&#160;</td>
          <td class="paramname"><em>allow_implicit</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Try to determine the type of a member <b>assuming it is active</b> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">srcstr</td><td>String containing an individual node (it may contain multi-line escape sequences) </td></tr>
    <tr><td class="paramname">len</td><td>Length of the node </td></tr>
    <tr><td class="paramname">allow_implicit</td><td>A boolean: <code>true</code> if keys without a key-value delimiter are allowed, <code>false</code> otherwise </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The active node type (see <a class="el" href="confini_8h.html" title="libconfini header">confini.h</a>) </dd></dl>

</div>
</div>
<a id="ab34de4f3cd8ff30c45ac7652457f695e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab34de4f3cd8ff30c45ac7652457f695e">&#9670;&nbsp;</a></span>getn_metachar_pos()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t getn_metachar_pos </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>chr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get the position of the first occurrence out of quotes of a given character, stopping after a given number of charcters. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The string where to search </td></tr>
    <tr><td class="paramname">chr</td><td>The character to to search </td></tr>
    <tr><td class="paramname">len</td><td>The maximum number of characters to read </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The offset of the first occurrence of <code>chr</code>, or <code>len</code> if <code>chr</code> has not been not found </dd></dl>

</div>
</div>
<a id="a75809c0e952d9f9e14333e085ba6b910"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a75809c0e952d9f9e14333e085ba6b910">&#9670;&nbsp;</a></span>ini_array_break()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* ini_array_break </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Replace the first delimiter found (together with the spaces that surround it) with <code>\0</code> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The stringified array (it can be <code>NULL</code>) </td></tr>
    <tr><td class="paramname">delimiter</td><td>The delimiter between the array members &ndash; if zero (see <a class="el" href="confini_8h.html#ad342637c37d95454c9392a8cc73bced8aa8d5a000ce9320e5dec88721095133cd">INI_ANY_SPACE</a>), any space is delimiter (<code>/(?:\\(?:\n\r?|\r\n?)|[\t \v\f])+/</code>) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A pointer to the remaining INI array or <code>NULL</code> if the remaining array is empty</dd></dl>
<p>Usually <code>ini_string</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well).</p>
<p>Similarly to <code>strtok_r()</code> this function can be used only once for a given string.</p>
<dl class="section note"><dt>Note</dt><dd>If <code>ini_string</code> comes from <a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf" title="Value to be assigned to implicit keys (default value: NULL)">INI_GLOBAL_IMPLICIT_VALUE</a> this function is no-op and will return <code>NULL</code>.</dd>
<dd>
If <code>delimiter</code> matches a metacharacter within the format given (<code>'\\'</code>, <code>'\''</code> or <code>'\&quot;'</code>), its role as metacharacter will have higher priority than its role as delimiter (i.e., the array will have no delimiters and will contain only one member).</dd></dl>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_array_break.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_ini_listener (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a5773ae8cbe4ce15737dcece84b362fa0">ini_string_match_si</a>(</div>
<div class="line">      <span class="stringliteral">&quot;my_array&quot;</span>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #define DELIMITER &#39;,&#39;</span></div>
<div class="line"> </div>
<div class="line">    <span class="keywordtype">char</span> * part_a, * part_b = dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>;</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">while</span> ((part_a = part_b)) {</div>
<div class="line"> </div>
<div class="line">      part_b = <a class="code" href="confini_8h.html#a75809c0e952d9f9e14333e085ba6b910">ini_array_break</a>(part_b, DELIMITER, dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>);</div>
<div class="line">      <a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(part_a, dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>);</div>
<div class="line">      printf(<span class="stringliteral">&quot;%s\n&quot;</span>, part_a);</div>
<div class="line"> </div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #undef DELIMITER</span></div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">      <span class="stringliteral">&quot;../ini_files/typed_ini.conf&quot;</span>,</div>
<div class="line">      <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">      NULL,</div>
<div class="line">      my_ini_listener,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html"><div class="ttname"><a href="confini_8h.html">confini.h</a></div><div class="ttdoc">libconfini header</div></div>
<div class="ttc" id="aconfini_8h_html_a54be108d26619db3066ce1c000dc8a17"><div class="ttname"><a href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a></div><div class="ttdeci">int load_ini_path(const char *const path, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)</div><div class="ttdoc">Parse an INI file and dispatch its content to a custom callback using a path as argument.</div><div class="ttdef"><b>Definition:</b> confini.c:3274</div></div>
<div class="ttc" id="aconfini_8h_html_a5773ae8cbe4ce15737dcece84b362fa0"><div class="ttname"><a href="confini_8h.html#a5773ae8cbe4ce15737dcece84b362fa0">ini_string_match_si</a></div><div class="ttdeci">bool ini_string_match_si(const char *const simple_string, const char *const ini_string, const IniFormat format)</div><div class="ttdoc">Compare a simple string and an INI string and and check whether they match.</div><div class="ttdef"><b>Definition:</b> confini.c:3470</div></div>
<div class="ttc" id="aconfini_8h_html_a75809c0e952d9f9e14333e085ba6b910"><div class="ttname"><a href="confini_8h.html#a75809c0e952d9f9e14333e085ba6b910">ini_array_break</a></div><div class="ttdeci">char * ini_array_break(char *const ini_string, const char delimiter, const IniFormat format)</div><div class="ttdoc">Replace the first delimiter found (together with the spaces that surround it) with \0</div><div class="ttdef"><b>Definition:</b> confini.c:5067</div></div>
<div class="ttc" id="aconfini_8h_html_aafa50d590c715f37b74fa5938a35a56f"><div class="ttname"><a href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a></div><div class="ttdeci">static const IniFormat INI_DEFAULT_FORMAT</div><div class="ttdoc">A model format for standard INI files.</div><div class="ttdef"><b>Definition:</b> confini.h:524</div></div>
<div class="ttc" id="aconfini_8h_html_ab4e3d48f0eb0438ba0c84fc77e362aa3"><div class="ttname"><a href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a></div><div class="ttdeci">size_t ini_string_parse(char *const ini_string, const IniFormat format)</div><div class="ttdoc">Unescape \', \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...</div><div class="ttdef"><b>Definition:</b> confini.c:4256</div></div>
<div class="ttc" id="astructIniDispatch_html"><div class="ttname"><a href="structIniDispatch.html">IniDispatch</a></div><div class="ttdoc">Dispatch of a single INI node.</div><div class="ttdef"><b>Definition:</b> confini.h:131</div></div>
<div class="ttc" id="astructIniDispatch_html_a3821b15b23e587eca172763dd4acd954"><div class="ttname"><a href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">IniDispatch::data</a></div><div class="ttdeci">char * data</div><div class="ttdef"><b>Definition:</b> confini.h:134</div></div>
<div class="ttc" id="astructIniDispatch_html_a8d7eb3387ff5ecb79900fae717234d16"><div class="ttname"><a href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">IniDispatch::value</a></div><div class="ttdeci">char * value</div><div class="ttdef"><b>Definition:</b> confini.h:135</div></div>
<div class="ttc" id="astructIniDispatch_html_adfda221d4a9effcb4f3ee6a99c5f2de2"><div class="ttname"><a href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">IniDispatch::format</a></div><div class="ttdeci">const IniFormat format</div><div class="ttdef"><b>Definition:</b> confini.h:132</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="aa0721fcae5f04e5a9edd485dc1ddd2fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0721fcae5f04e5a9edd485dc1ddd2fa">&#9670;&nbsp;</a></span>ini_array_collapse()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ini_array_collapse </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compress the distribution of the data in a stringified INI array by removing all the white spaces that surround its delimiters, empty quotes, collapsable spaces, etc. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The stringified array </td></tr>
    <tr><td class="paramname">delimiter</td><td>The delimiter between the array members &ndash; if zero (<code>INI_ANY_SPACE</code>) any space is delimiter (<code>/(?:\\(?:\n\r?|\r\n?)|[\t \v\f])+/</code>) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the stringified array</dd></dl>
<p>Out of quotes similar to ECMAScript <code>ini_string.replace(new RegExp("^\\s+|\\s*(?:(" + delimiter + ")\\s*|($))", "g"), "$1$2")</code>. If <a class="el" href="confini_8h.html#ad342637c37d95454c9392a8cc73bced8aa8d5a000ce9320e5dec88721095133cd">INI_ANY_SPACE</a> (<code>0</code>) is used as delimiter, one or more different spaces (<code>/[\t \v\f\n\r]+/</code>) will be always collapsed to one space, independently of what the format says.</p>
<p>Usually <code>ini_string</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well).</p>
<p>This function can be useful before invoking <code>memcpy()</code> using <code>ini_string</code> as source, when saving memory is a priority.</p>
<p>The <code>format</code> argument is used for the following fields:</p>
<ul>
<li><code>format.no_single_quotes</code></li>
<li><code>format.no_double_quotes</code></li>
<li><code>format.do_not_collapse_values</code></li>
<li><code>format.preserve_empty_quotes</code></li>
</ul>
<p>Examples:</p>
<ol type="1">
<li>Using comma as delimiter:<ul>
<li>Before: <code>&#160;first&#160;&#160; ,&#160;&#160;&#160; second&#160;&#160; ,&#160;&#160; third&#160;&#160; ,&#160; etc.&#160;&#160;</code></li>
<li>After: <code>first,second,third,etc.</code></li>
</ul>
</li>
<li>Using <code>INI_ANY_SPACE</code> as delimiter:<ul>
<li>Before: <code>&#160;&#160;first&#160;&#160;&#160; second&#160;&#160;&#160; third&#160;&#160;&#160;&#160; etc.&#160;&#160;&#160;</code></li>
<li>After: <code>first second third etc.</code></li>
</ul>
</li>
</ol>
<dl class="section note"><dt>Note</dt><dd>If <code>ini_string</code> comes from <a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf" title="Value to be assigned to implicit keys (default value: NULL)">INI_GLOBAL_IMPLICIT_VALUE</a> this function is no-op and will only return the value of <a class="el" href="confini_8c.html#acecf086ca074b27365e877f056af2192" title="Length of the value assigned to implicit keys (default value: 0)">INI_GLOBAL_IMPLICIT_V_LEN</a> minus the offset of <code>ini_string</code> within <a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf" title="Value to be assigned to implicit keys (default value: NULL)">INI_GLOBAL_IMPLICIT_VALUE</a>.</dd>
<dd>
If <code>delimiter</code> matches a metacharacter within the format given (<code>'\\'</code>, <code>'\''</code> or <code>'\&quot;'</code>), its role as metacharacter will have higher priority than its role as delimiter (i.e., the array will have no delimiters and will contain only one member).</dd></dl>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_array_collapse.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> populate_strarray (</div>
<div class="line">  <span class="keywordtype">char</span> * <span class="keyword">const</span> part,</div>
<div class="line">  <span class="keyword">const</span> <span class="keywordtype">size_t</span> part_len,</div>
<div class="line">  <span class="keyword">const</span> <span class="keywordtype">size_t</span> idx,</div>
<div class="line">  <span class="keyword">const</span> <a class="code" href="structIniFormat.html">IniFormat</a> format,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_array</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  <a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(part, format);</div>
<div class="line">  ((<span class="keywordtype">char</span> **) v_array)[idx] = part;</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_ini_listener (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a5773ae8cbe4ce15737dcece84b362fa0">ini_string_match_si</a>(</div>
<div class="line">      <span class="stringliteral">&quot;my_array&quot;</span>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #define DELIMITER &#39;,&#39;</span></div>
<div class="line"> </div>
<div class="line">    <span class="keywordtype">char</span> ** my_array;</div>
<div class="line">    <span class="keywordtype">size_t</span> my_array_length;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*  Save memory with `ini_array_collapse()`  */</span></div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a> = <a class="code" href="confini_8h.html#aa0721fcae5f04e5a9edd485dc1ddd2fa">ini_array_collapse</a>(</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">      DELIMITER,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">    );</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*  Allocate a new array of strings with `malloc()`  */</span></div>
<div class="line">    my_array_length = <a class="code" href="confini_8h.html#a312803fa24be2d7f164f3041fbfa6865">ini_array_get_length</a>(</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">      DELIMITER,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">    );</div>
<div class="line"> </div>
<div class="line">    my_array = (<span class="keywordtype">char</span> **) malloc(my_array_length * <span class="keyword">sizeof</span>(<span class="keywordtype">char</span> *) +</div>
<div class="line">                 dispatch-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a> + 1);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*  Copy the strings with `memcpy()`  */</span></div>
<div class="line">    memcpy(</div>
<div class="line">      my_array + my_array_length,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a> + 1</div>
<div class="line">    );</div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*  Populate the array  */</span></div>
<div class="line">    <a class="code" href="confini_8h.html#a04acd6a01a6a78810e7aab8e02923218">ini_array_split</a>(</div>
<div class="line">      (<span class="keywordtype">char</span> *) (my_array + my_array_length),</div>
<div class="line">      DELIMITER,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>,</div>
<div class="line">      populate_strarray,</div>
<div class="line">      my_array</div>
<div class="line">    );</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #undef DELIMITER</span></div>
<div class="line"> </div>
<div class="line">    <span class="comment">/*  Do something with `my_array`  */</span></div>
<div class="line">    printf(<span class="stringliteral">&quot;Array `my_array` has been created.\n\n&quot;</span>);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> idx = 0; idx &lt; my_array_length; idx++) {</div>
<div class="line"> </div>
<div class="line">      printf(<span class="stringliteral">&quot;my_array[%zu] -&gt; %s\n&quot;</span>, idx, my_array[idx]);</div>
<div class="line"> </div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">      <span class="stringliteral">&quot;../ini_files/typed_ini.conf&quot;</span>,</div>
<div class="line">      <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">      NULL,</div>
<div class="line">      my_ini_listener,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html_a04acd6a01a6a78810e7aab8e02923218"><div class="ttname"><a href="confini_8h.html#a04acd6a01a6a78810e7aab8e02923218">ini_array_split</a></div><div class="ttdeci">int ini_array_split(char *const ini_string, const char delimiter, const IniFormat format, const IniStrHandler f_foreach, void *const user_data)</div><div class="ttdoc">Split a stringified INI array into NUL-separated members and call a custom function for each member.</div><div class="ttdef"><b>Definition:</b> confini.c:5226</div></div>
<div class="ttc" id="aconfini_8h_html_a312803fa24be2d7f164f3041fbfa6865"><div class="ttname"><a href="confini_8h.html#a312803fa24be2d7f164f3041fbfa6865">ini_array_get_length</a></div><div class="ttdeci">size_t ini_array_get_length(const char *const ini_string, const char delimiter, const IniFormat format)</div><div class="ttdoc">Get the length of a stringified INI array in number of members.</div><div class="ttdef"><b>Definition:</b> confini.c:4472</div></div>
<div class="ttc" id="aconfini_8h_html_aa0721fcae5f04e5a9edd485dc1ddd2fa"><div class="ttname"><a href="confini_8h.html#aa0721fcae5f04e5a9edd485dc1ddd2fa">ini_array_collapse</a></div><div class="ttdeci">size_t ini_array_collapse(char *const ini_string, const char delimiter, const IniFormat format)</div><div class="ttdoc">Compress the distribution of the data in a stringified INI array by removing all the white spaces tha...</div><div class="ttdef"><b>Definition:</b> confini.c:4838</div></div>
<div class="ttc" id="astructIniDispatch_html_a67b4c4b61e3c801cbfbcca95073ce864"><div class="ttname"><a href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">IniDispatch::v_len</a></div><div class="ttdeci">size_t v_len</div><div class="ttdef"><b>Definition:</b> confini.h:138</div></div>
<div class="ttc" id="astructIniFormat_html"><div class="ttname"><a href="structIniFormat.html">IniFormat</a></div><div class="ttdoc">24-bit bitfield representing the format of an INI file (INI dialect)</div><div class="ttdef"><b>Definition:</b> confini.h:115</div></div>
</div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>The actual space occupied by the array might get reduced further after each member is parsed by <a class="el" href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3" title="Unescape \&#39;, \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...">ini_string_parse()</a>. </dd></dl>

</div>
</div>
<a id="a414c3b92adf45dbb966df1606b71ccdf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a414c3b92adf45dbb966df1606b71ccdf">&#9670;&nbsp;</a></span>ini_array_foreach()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ini_array_foreach </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="confini_8h.html#a9cb562c563beb848850cc429a0a022ac">IniSubstrHandler</a>&#160;</td>
          <td class="paramname"><em>f_foreach</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *const&#160;</td>
          <td class="paramname"><em>user_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Call a custom function for each member of a stringified INI array, without modifying the content of the buffer &ndash; useful for read-only (<code>const</code>) stringified arrays. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The stringified array (it can be <code>NULL</code>) </td></tr>
    <tr><td class="paramname">delimiter</td><td>The delimiter between the array members &ndash; if zero (see <a class="el" href="confini_8h.html#ad342637c37d95454c9392a8cc73bced8aa8d5a000ce9320e5dec88721095133cd">INI_ANY_SPACE</a>), any space is delimiter (<code>/(?:\\(?:\n\r?|\r\n?)|[\t \v\f])+/</code>) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
    <tr><td class="paramname">f_foreach</td><td>The function that will be invoked for each array member </td></tr>
    <tr><td class="paramname">user_data</td><td>A custom argument, or <code>NULL</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero for success, otherwise an error code (see <code>enum</code> <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29" title="Error codes.">ConfiniInterruptNo</a>)</dd></dl>
<p>Usually <code>ini_string</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well).</p>
<p>The user given function <code>f_foreach</code> (see <a class="el" href="confini_8h.html#a9cb562c563beb848850cc429a0a022ac" title="Callback function for handling a selected fragment of an INI string.">IniSubstrHandler</a> data type) will be invoked with six arguments: <code>ini_string</code>, <code>memb_offset</code> (the offset of the member in bytes), <code>memb_length</code> (the length of the member in bytes), <code>memb_num</code> (the offset of the member in number of members), <code>format</code> (the format of the INI file), <code>user_data</code> (the custom argument <code>user_data</code> previously passed). If <code>f_foreach</code> returns a non-zero value the function <a class="el" href="confini_8c.html#a414c3b92adf45dbb966df1606b71ccdf" title="Call a custom function for each member of a stringified INI array, without modifying the content of t...">ini_array_foreach()</a> will be interrupted.</p>
<dl class="section note"><dt>Note</dt><dd>If <code>delimiter</code> matches a metacharacter within the format given (<code>'\\'</code>, <code>'\''</code> or <code>'\&quot;'</code>), its role as metacharacter will have higher priority than its role as delimiter (i.e., the array will have no delimiters and will contain only one member).</dd></dl>
<p>Possible return values are: <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29ab6180fd6db09408e11eb1c27fb7028e7">CONFINI_SUCCESS</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a133a335ff201d93015a27bd581e6b399">CONFINI_FEINTR</a>.</p>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_array_foreach.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_array_fragm_handler (</div>
<div class="line">  <span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> ini_array,</div>
<div class="line">  <span class="keyword">const</span> <span class="keywordtype">size_t</span> fragm_offset,</div>
<div class="line">  <span class="keyword">const</span> <span class="keywordtype">size_t</span> fragm_length,</div>
<div class="line">  <span class="keyword">const</span> <span class="keywordtype">size_t</span> fragm_num,</div>
<div class="line">  <span class="keyword">const</span> <a class="code" href="structIniFormat.html">IniFormat</a> format,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> user_data</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  printf(<span class="stringliteral">&quot;\&quot;%.*s\&quot;\n&quot;</span>, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) fragm_length, ini_array + fragm_offset);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <a class="code" href="confini_8h.html#a414c3b92adf45dbb966df1606b71ccdf">ini_array_foreach</a>(</div>
<div class="line">    <span class="stringliteral">&quot;first  ,  second   ,  third&quot;</span>,</div>
<div class="line">    <span class="charliteral">&#39;,&#39;</span>,</div>
<div class="line">    <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">    my_array_fragm_handler,</div>
<div class="line">    NULL</div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html_a414c3b92adf45dbb966df1606b71ccdf"><div class="ttname"><a href="confini_8h.html#a414c3b92adf45dbb966df1606b71ccdf">ini_array_foreach</a></div><div class="ttdeci">int ini_array_foreach(const char *const ini_string, const char delimiter, const IniFormat format, const IniSubstrHandler f_foreach, void *const user_data)</div><div class="ttdoc">Call a custom function for each member of a stringified INI array, without modifying the content of t...</div><div class="ttdef"><b>Definition:</b> confini.c:4593</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="a312803fa24be2d7f164f3041fbfa6865"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a312803fa24be2d7f164f3041fbfa6865">&#9670;&nbsp;</a></span>ini_array_get_length()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ini_array_get_length </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the length of a stringified INI array in number of members. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The stringified array (it can be <code>NULL</code>) </td></tr>
    <tr><td class="paramname">delimiter</td><td>The delimiter between the array members &ndash; if zero (see <a class="el" href="confini_8h.html#ad342637c37d95454c9392a8cc73bced8aa8d5a000ce9320e5dec88721095133cd">INI_ANY_SPACE</a>), any space is delimiter (<code>/(?:\\(?:\n\r?|\r\n?)|[\t \v\f])+/</code>) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The length of the INI array in number of members</dd></dl>
<p>Usually <code>ini_string</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well).</p>
<dl class="section note"><dt>Note</dt><dd>If <code>delimiter</code> matches a metacharacter within the format given (<code>'\\'</code>, <code>'\''</code> or <code>'\&quot;'</code>), its role as metacharacter will have higher priority than its role as delimiter (i.e., the array will have no delimiters and will contain only one member). </dd></dl>

</div>
</div>
<a id="a76a050b341e311cc9bbb79b399691e12"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a76a050b341e311cc9bbb79b399691e12">&#9670;&nbsp;</a></span>ini_array_match()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ini_array_match </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>ini_string_a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>ini_string_b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compare two INI arrays and check whether they match. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string_a</td><td>The first INI array </td></tr>
    <tr><td class="paramname">ini_string_b</td><td>The second INI array </td></tr>
    <tr><td class="paramname">delimiter</td><td>The delimiter between the array members &ndash; if zero (see <a class="el" href="confini_8h.html#ad342637c37d95454c9392a8cc73bced8aa8d5a000ce9320e5dec88721095133cd">INI_ANY_SPACE</a>), any space is delimiter (<code>/(?:\\(?:\n\r?|\r\n?)|[\t \v\f])+/</code>) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A boolean: <code>true</code> if the two arrays match, <code>false</code> otherwise</dd></dl>
<p>This function grants that the result of the comparison between two INI arrays will always match the the <em>literal</em> comparison between the individual members of both arrays after these have been parsed, one by one, by <a class="el" href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3" title="Unescape \&#39;, \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...">ini_string_parse()</a> (with <code>format.do_not_collapse_values</code> set to <code>false</code>).</p>
<p>This function can be used, with <code>'.'</code> as delimiter, to compare section paths.</p>
<p>INI strings are the strings typically dispatched by <a class="el" href="confini_8c.html#a7d5042d3044dfb5a34a6bfc5af3a882d" title="Parse an INI file and dispatch its content to a custom callback using a FILE structure as argument.">load_ini_file()</a>, <a class="el" href="confini_8c.html#a54be108d26619db3066ce1c000dc8a17" title="Parse an INI file and dispatch its content to a custom callback using a path as argument.">load_ini_path()</a> or <a class="el" href="confini_8c.html#a25d648d387f6e8bc36e7965accfca63b" title="Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback.">strip_ini_cache()</a>, which may contain quotes and the three escape sequences <code>\\</code>, <code>\'</code> and <code>\&quot;</code>.</p>
<p>In order to be suitable for both names and values, <b>this function always considers sequences of one or more spaces out of quotes in both strings as collapsed</b>, even when <code>format.do_not_collapse_values</code> is set to <code>true</code>.</p>
<p>The <code>format</code> argument is used for the following fields:</p>
<ul>
<li><code>format.case_sensitive</code></li>
<li><code>format.no_double_quotes</code></li>
<li><code>format.no_single_quotes</code></li>
<li><code>format.multiline_nodes</code> (<code><a class="el" href="confini_8h.html#ae74cb0104512ee3dfe2865abe689e3f5" title="Check whether a format does not support escape sequences.">INIFORMAT_HAS_NO_ESC()</a></code>) </li>
</ul>

</div>
</div>
<a id="a2b34dc032fc37dda829dadf80bf34d26"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2b34dc032fc37dda829dadf80bf34d26">&#9670;&nbsp;</a></span>ini_array_release()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* ini_array_release </td>
          <td>(</td>
          <td class="paramtype">char **const&#160;</td>
          <td class="paramname"><em>ini_strptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Replace the first delimiter found (together with the spaces that surround it) with <code>\0</code>, then shifts the location pointed by <code>ini_strptr</code> to the next member of the INI array, or to <code>NULL</code> if the INI array has no more members. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_strptr</td><td>The memory location of the stringified array &ndash; it cannot be <code>NULL</code>, but it can point to <code>NULL</code> </td></tr>
    <tr><td class="paramname">delimiter</td><td>The delimiter between the array members &ndash; if zero (see <a class="el" href="confini_8h.html#ad342637c37d95454c9392a8cc73bced8aa8d5a000ce9320e5dec88721095133cd">INI_ANY_SPACE</a>), any space is delimiter (<code>/(?:\\(?:\n\r?|\r\n?)|[\t \v\f])+/</code>) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The array member that has been released</dd></dl>
<p>Usually <code>ini_strptr</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well).</p>
<p>Similarly to <code>strtok_r()</code> this function can be used only once for a given string.</p>
<dl class="section note"><dt>Note</dt><dd>If <code>ini_string</code> comes from <a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf" title="Value to be assigned to implicit keys (default value: NULL)">INI_GLOBAL_IMPLICIT_VALUE</a> this function is no-op and will set <code>ini_strptr</code> to <code>NULL</code>.</dd>
<dd>
If <code>delimiter</code> matches a metacharacter within the format given (<code>'\\'</code>, <code>'\''</code> or <code>'\&quot;'</code>), its role as metacharacter will have higher priority than its role as delimiter (i.e., the array will have no delimiters and will contain only one member).</dd></dl>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_array_release.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_ini_listener (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a5773ae8cbe4ce15737dcece84b362fa0">ini_string_match_si</a>(</div>
<div class="line">      <span class="stringliteral">&quot;my_array&quot;</span>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #define DELIMITER &#39;,&#39;</span></div>
<div class="line"> </div>
<div class="line">    <span class="keywordtype">char</span> * token, * remaining = dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>;</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">while</span> ((</div>
<div class="line">      token = <a class="code" href="confini_8h.html#a2b34dc032fc37dda829dadf80bf34d26">ini_array_release</a>(&amp;remaining, DELIMITER, dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>)</div>
<div class="line">    )) {</div>
<div class="line"> </div>
<div class="line">      <a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(token, dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>);</div>
<div class="line">      printf(<span class="stringliteral">&quot;%s\n&quot;</span>, token);</div>
<div class="line"> </div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #undef DELIMITER</span></div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">      <span class="stringliteral">&quot;../ini_files/typed_ini.conf&quot;</span>,</div>
<div class="line">      <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">      NULL,</div>
<div class="line">      my_ini_listener,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html_a2b34dc032fc37dda829dadf80bf34d26"><div class="ttname"><a href="confini_8h.html#a2b34dc032fc37dda829dadf80bf34d26">ini_array_release</a></div><div class="ttdeci">char * ini_array_release(char **const ini_strptr, const char delimiter, const IniFormat format)</div><div class="ttdoc">Replace the first delimiter found (together with the spaces that surround it) with \0,...</div><div class="ttdef"><b>Definition:</b> confini.c:5146</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="a6ca567ad863caef4609f8def7de0401a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ca567ad863caef4609f8def7de0401a">&#9670;&nbsp;</a></span>ini_array_shift()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ini_array_shift </td>
          <td>(</td>
          <td class="paramtype">const char **const&#160;</td>
          <td class="paramname"><em>ini_strptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Shift the location pointed by <code>ini_strptr</code> to the next member of the INI array (without modifying the content of the buffer), or to <code>NULL</code> if the INI array has no more members &ndash; useful for read-only (<code>const</code>) stringified arrays. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_strptr</td><td>The memory location of the stringified array &ndash; it cannot be <code>NULL</code>, but it can point to <code>NULL</code> </td></tr>
    <tr><td class="paramname">delimiter</td><td>The delimiter between the array members &ndash; if zero (see <a class="el" href="confini_8h.html#ad342637c37d95454c9392a8cc73bced8aa8d5a000ce9320e5dec88721095133cd">INI_ANY_SPACE</a>), any space is delimiter (<code>/(?:\\(?:\n\r?|\r\n?)|[\t \v\f])+/</code>) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The length of the array member that has been left behind</dd></dl>
<p>Usually <code>ini_strptr</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well).</p>
<dl class="section note"><dt>Note</dt><dd>If <code>delimiter</code> matches a metacharacter within the format given (<code>'\\'</code>, <code>'\''</code> or <code>'\&quot;'</code>), its role as metacharacter will have higher priority than its role as delimiter (i.e., the array will have no delimiters and will contain only one member).</dd></dl>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_array_shift.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_ini_listener (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a5773ae8cbe4ce15737dcece84b362fa0">ini_string_match_si</a>(</div>
<div class="line">      <span class="stringliteral">&quot;my_array&quot;</span>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #define DELIMITER &#39;,&#39;</span></div>
<div class="line"> </div>
<div class="line">    <span class="keywordtype">size_t</span> length;</div>
<div class="line">    <span class="keywordtype">char</span> * left_behind, * shifted = dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>;</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">while</span> ((left_behind = shifted)) {</div>
<div class="line"> </div>
<div class="line">      length = <a class="code" href="confini_8h.html#a6ca567ad863caef4609f8def7de0401a">ini_array_shift</a>(</div>
<div class="line">                 (<span class="keyword">const</span> <span class="keywordtype">char</span> **) &amp;shifted,</div>
<div class="line">                 DELIMITER,</div>
<div class="line">                 dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">               );</div>
<div class="line"> </div>
<div class="line">      printf(<span class="stringliteral">&quot;%.*s\n&quot;</span>, (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>) length, left_behind);</div>
<div class="line"> </div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">    #undef DELIMITER</span></div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">      <span class="stringliteral">&quot;../ini_files/typed_ini.conf&quot;</span>,</div>
<div class="line">      <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">      NULL,</div>
<div class="line">      my_ini_listener,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html_a6ca567ad863caef4609f8def7de0401a"><div class="ttname"><a href="confini_8h.html#a6ca567ad863caef4609f8def7de0401a">ini_array_shift</a></div><div class="ttdeci">size_t ini_array_shift(const char **const ini_strptr, const char delimiter, const IniFormat format)</div><div class="ttdoc">Shift the location pointed by ini_strptr to the next member of the INI array (without modifying the c...</div><div class="ttdef"><b>Definition:</b> confini.c:4740</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="a04acd6a01a6a78810e7aab8e02923218"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a04acd6a01a6a78810e7aab8e02923218">&#9670;&nbsp;</a></span>ini_array_split()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ini_array_split </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>delimiter</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="confini_8h.html#aecbba63912eba3f61427599e719ffd7b">IniStrHandler</a>&#160;</td>
          <td class="paramname"><em>f_foreach</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *const&#160;</td>
          <td class="paramname"><em>user_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Split a stringified INI array into NUL-separated members and call a custom function for each member. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The stringified array (it cannot be <code>NULL</code>) </td></tr>
    <tr><td class="paramname">delimiter</td><td>The delimiter between the array members &ndash; if zero (see <a class="el" href="confini_8h.html#ad342637c37d95454c9392a8cc73bced8aa8d5a000ce9320e5dec88721095133cd">INI_ANY_SPACE</a>), any space is delimiter (<code>/(?:\\(?:\n\r?|\r\n?)|[\t \v\f])+/</code>) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
    <tr><td class="paramname">f_foreach</td><td>The function that will be invoked for each array member </td></tr>
    <tr><td class="paramname">user_data</td><td>A custom argument, or <code>NULL</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero for success, otherwise an error code (see <code>enum</code> <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29" title="Error codes.">ConfiniInterruptNo</a>)</dd></dl>
<p>Usually <code>ini_string</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well).</p>
<p>The user given function <code>f_foreach</code> (see <a class="el" href="confini_8h.html#aecbba63912eba3f61427599e719ffd7b" title="Callback function for handling an INI string belonging to a sequence of INI strings.">IniStrHandler</a> data type) will be invoked with five arguments: <code>member</code> (the member of the array), <code>memb_length</code> (the length of the member in bytes), <code>memb_num</code> (the offset of the member in number of members), <code>format</code> (the format of the INI file), <code>user_data</code> (the custom argument <code>user_data</code> previously passed). If <code>f_foreach</code> returns a non-zero value the function <a class="el" href="confini_8c.html#a04acd6a01a6a78810e7aab8e02923218" title="Split a stringified INI array into NUL-separated members and call a custom function for each member.">ini_array_split()</a> will be interrupted.</p>
<p>Similarly to <code>strtok_r()</code> this function can be used only once for a given string.</p>
<dl class="section note"><dt>Note</dt><dd>If <code>ini_string</code> comes from <a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf" title="Value to be assigned to implicit keys (default value: NULL)">INI_GLOBAL_IMPLICIT_VALUE</a> or is <code>NULL</code> this function is no-op and will return an error code.</dd>
<dd>
If <code>delimiter</code> matches a metacharacter within the format given (<code>'\\'</code>, <code>'\''</code> or <code>'\&quot;'</code>), its role as metacharacter will have higher priority than its role as delimiter (i.e., the array will have no delimiters and will contain only one member).</dd></dl>
<p>Possible return values are: <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29ab6180fd6db09408e11eb1c27fb7028e7">CONFINI_SUCCESS</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a701eeae64743243474d43bc85d7b3265">CONFINI_EROADDR</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a133a335ff201d93015a27bd581e6b399">CONFINI_FEINTR</a>.</p>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_array_split.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_array_memb_handler (</div>
<div class="line">  <span class="keywordtype">char</span> * <span class="keyword">const</span> arr_member,</div>
<div class="line">  <span class="keyword">const</span> <span class="keywordtype">size_t</span> memb_length,</div>
<div class="line">  <span class="keyword">const</span> <span class="keywordtype">size_t</span> memb_num,</div>
<div class="line">  <span class="keyword">const</span> <a class="code" href="structIniFormat.html">IniFormat</a> format,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> foreach_other</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  printf(<span class="stringliteral">&quot;\&quot;%s\&quot;\n&quot;</span>, arr_member);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordtype">char</span> my_ini_array[] = <span class="stringliteral">&quot;first .   second   . third&quot;</span>;</div>
<div class="line"> </div>
<div class="line">  <a class="code" href="confini_8h.html#a04acd6a01a6a78810e7aab8e02923218">ini_array_split</a>(</div>
<div class="line">    my_ini_array,</div>
<div class="line">    <span class="charliteral">&#39;.&#39;</span>,</div>
<div class="line">    <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">    my_array_memb_handler,</div>
<div class="line">    NULL</div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
</div><!-- fragment --> 
</div>
</div>
<a id="a02bf5a1299ffb85fbd2f087cffbc1db8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a02bf5a1299ffb85fbd2f087cffbc1db8">&#9670;&nbsp;</a></span>ini_fton()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="confini_8h.html#a47a6a31dd11db39ac287147955733511">IniFormatNum</a> ini_fton </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>source</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Calculate the <a class="el" href="confini_8h.html#a47a6a31dd11db39ac287147955733511" title="The unique ID of an INI format (24-bit maximum)">IniFormatNum</a> of an <a class="el" href="structIniFormat.html" title="24-bit bitfield representing the format of an INI file (INI dialect)">IniFormat</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">source</td><td>The <a class="el" href="structIniFormat.html" title="24-bit bitfield representing the format of an INI file (INI dialect)">IniFormat</a> to compute </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The unique unsigned integer that identifies the format given </dd></dl>

</div>
</div>
<a id="ac43249a99e97f1d669a80c22a3e42564"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac43249a99e97f1d669a80c22a3e42564">&#9670;&nbsp;</a></span>ini_get_bool()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ini_get_bool </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>simple_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>when_fail</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check whether a simple string matches one of the booleans listed in the private constant <a class="el" href="confini_8c.html#afdb9fd02d693536253da07f0f468aaef" title="A list of possible string representations of boolean pairs.">INI_BOOLEANS</a> (case-insensitive) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">simple_string</td><td>A string to check (it can be <code>NULL</code>) </td></tr>
    <tr><td class="paramname">when_fail</td><td>The value that is returned if no matching boolean is found </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The matching boolean (<code>0</code> or <code>1</code>) or <code>when_fail</code> if <code>simple_string</code> does not contain a valid INI boolean</dd></dl>
<div class="fragment"><div class="line"><span class="comment">/*  examples/miscellanea/typed_ini.c  */</span></div>
<div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">The following code will try to read an INI section called `my_section`,</span></div>
<div class="line"><span class="comment">expected to contain the following typed data:</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.ini}</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">[my_section]</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">my_string = [string]</span></div>
<div class="line"><span class="comment">my_number = [number]</span></div>
<div class="line"><span class="comment">my_boolean = [boolean]</span></div>
<div class="line"><span class="comment">my_implicit_boolean</span></div>
<div class="line"><span class="comment">my_array = [comma-delimited array]</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">No errors will be generated if any of the data above are absent.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;../utilities/make_strarray.h&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#define MY_ARRAY_DELIMITER &#39;,&#39;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">/*  My stored data  */</span></div>
<div class="line"><span class="keyword">struct </span>ini_store {</div>
<div class="line">  <span class="keywordtype">char</span> * my_section_my_string;</div>
<div class="line">  <span class="keywordtype">int</span> my_section_my_number;</div>
<div class="line">  <span class="keywordtype">bool</span> my_section_my_boolean;</div>
<div class="line">  <span class="keywordtype">bool</span> my_section_my_implicit_bool;</div>
<div class="line">  <span class="keywordtype">char</span> * <span class="keyword">const</span> * my_section_my_array;</div>
<div class="line">  <span class="keywordtype">size_t</span> my_section_my_arr_len;</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_init (<a class="code" href="structIniStatistics.html">IniStatistics</a> * statistics, <span class="keywordtype">void</span> * v_store) {</div>
<div class="line">  *((<span class="keyword">struct </span>ini_store *) v_store) = (<span class="keyword">struct </span>ini_store) {</div>
<div class="line">    .my_section_my_string = NULL,</div>
<div class="line">    .my_section_my_number = -1,</div>
<div class="line">    .my_section_my_boolean = <span class="keyword">false</span>,</div>
<div class="line">    .my_section_my_implicit_bool = <span class="keyword">false</span>,</div>
<div class="line">    .my_section_my_array = NULL,</div>
<div class="line">    .my_section_my_arr_len = 0</div>
<div class="line">  };</div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_handler (<a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dsp, <span class="keywordtype">void</span> * <span class="keyword">const</span> v_store) {</div>
<div class="line"><span class="preprocessor">  #define store ((struct ini_store *) v_store)</span></div>
<div class="line"><span class="preprocessor">  #define THEYMATCH(SSTR, ISTR) \</span></div>
<div class="line"><span class="preprocessor">    ini_string_match_si(SSTR, ISTR, dsp-&gt;format)</span></div>
<div class="line">  <span class="keywordflow">if</span> (dsp-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a> == <a class="code" href="confini_8h.html#a4e394db479f56eaa830ade09c907461ba97333d01dfff8f9a9c690fc559751b45">INI_KEY</a> &amp;&amp; THEYMATCH(<span class="stringliteral">&quot;my_section&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#ae3aca4d49e430c9180b4f80b3f0624d9">append_to</a>)) {</div>
<div class="line">    <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_string&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      dsp-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a> = <a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>);</div>
<div class="line">      <span class="comment">/*  Free previous duplicate key (if any)  */</span></div>
<div class="line">      free(store-&gt;my_section_my_string);</div>
<div class="line">      <span class="comment">/*  Allocate the new string  */</span></div>
<div class="line">      store-&gt;my_section_my_string = strndup(dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, dsp-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a>);</div>
<div class="line">      <span class="keywordflow">if</span> (!store-&gt;my_section_my_string) {</div>
<div class="line">        <span class="keywordflow">return</span> 1;</div>
<div class="line">      }</div>
<div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_number&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      store-&gt;my_section_my_number = <a class="code" href="confini_8h.html#adba0d5ee273d05ed845c66f01a621119">ini_get_int</a>(dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>);</div>
<div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_boolean&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      store-&gt;my_section_my_boolean = <a class="code" href="confini_8h.html#a5d3460168636cfdffc6fb76be7c9b6b3">ini_get_bool_i</a>(</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">        0,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">      );</div>
<div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_implicit_boolean&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      store-&gt;my_section_my_implicit_bool = <a class="code" href="confini_8h.html#a5d3460168636cfdffc6fb76be7c9b6b3">ini_get_bool_i</a>(</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">        1,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">      );</div>
<div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_array&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      <span class="comment">/*  Save memory (not strictly needed)  */</span></div>
<div class="line">      dsp-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a> = <a class="code" href="confini_8h.html#aa0721fcae5f04e5a9edd485dc1ddd2fa">ini_array_collapse</a>(</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">        MY_ARRAY_DELIMITER,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">      );</div>
<div class="line">      <span class="comment">/*  Free previous duplicate key (if any)  */</span></div>
<div class="line">      free((<span class="keywordtype">void</span> *) store-&gt;my_section_my_array);</div>
<div class="line">      <span class="comment">/*  Allocate a new array of strings  */</span></div>
<div class="line">      <span class="comment">/*  Function in examples/utilities/make_strarray.h  */</span></div>
<div class="line">      store-&gt;my_section_my_array = make_strarray(</div>
<div class="line">        &amp;store-&gt;my_section_my_arr_len,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a>,</div>
<div class="line">        MY_ARRAY_DELIMITER,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">      );</div>
<div class="line">      <span class="keywordflow">if</span> (!store-&gt;my_section_my_array) {</div>
<div class="line">        <span class="keywordflow">return</span> 1;</div>
<div class="line">      }</div>
<div class="line">    }</div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="preprocessor">  #undef THEYMATCH</span></div>
<div class="line"><span class="preprocessor">  #undef store</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> print_stored_data (<span class="keyword">const</span> <span class="keyword">struct</span> ini_store * <span class="keyword">const</span> store) {</div>
<div class="line">  printf(</div>
<div class="line">    <span class="stringliteral">&quot;my_string -&gt; %s\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;my_number -&gt; %d\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;my_boolean -&gt; %s\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;my_implicit_boolean -&gt; %s\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;my_array[%zu] -&gt; [%s&quot;</span>,</div>
<div class="line">    store-&gt;my_section_my_string,</div>
<div class="line">    store-&gt;my_section_my_number,</div>
<div class="line">    store-&gt;my_section_my_boolean ? <span class="stringliteral">&quot;True (`1`)&quot;</span> : <span class="stringliteral">&quot;False (`0`)&quot;</span>,</div>
<div class="line">    store-&gt;my_section_my_implicit_bool ? <span class="stringliteral">&quot;True (`1`)&quot;</span> : <span class="stringliteral">&quot;False (`0`)&quot;</span>,</div>
<div class="line">    store-&gt;my_section_my_arr_len,</div>
<div class="line">    store-&gt;my_section_my_arr_len ? store-&gt;my_section_my_array[0] : <span class="stringliteral">&quot;&quot;</span></div>
<div class="line">  );</div>
<div class="line">  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> idx = 1; idx &lt; store-&gt;my_section_my_arr_len; idx++) {</div>
<div class="line">    printf(<span class="stringliteral">&quot;|%s&quot;</span>, store-&gt;my_section_my_array[idx]);</div>
<div class="line">  }</div>
<div class="line">  printf(<span class="stringliteral">&quot;]\n&quot;</span>);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line">  <a class="code" href="structIniFormat.html">IniFormat</a> my_format;</div>
<div class="line">  <span class="keyword">struct </span>ini_store my_store;</div>
<div class="line">  <a class="code" href="confini_8h.html#a3a6eb3b79a88304864341075240ee412">ini_global_set_implicit_value</a>(<span class="stringliteral">&quot;YES&quot;</span>, 3);</div>
<div class="line">  my_format = <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>;</div>
<div class="line">  my_format.<a class="code" href="structIniFormat.html#ae5722efd535f1d27c624a927eea622c3">implicit_is_not_empty</a> = <span class="keyword">true</span>;</div>
<div class="line">  my_format.<a class="code" href="structIniFormat.html#ab5937aaf72b0ce5b62aece8d23ad7b82">disabled_can_be_implicit</a> = <span class="keyword">true</span>;</div>
<div class="line">  my_format.<a class="code" href="structIniFormat.html#aab0c2bf1e89593bbbfc9ac5fc5f6f552">semicolon_marker</a> = my_format.<a class="code" href="structIniFormat.html#a4d9984334335612830eef223e0adc913">hash_marker</a> = <a class="code" href="confini_8h.html#a6f7ff029dfae5a0e3bb5bc08f887bdcda37cb73b9bfc8bc6cc9d887108b4168bd">INI_IGNORE</a>;</div>
<div class="line">  <span class="keywordflow">if</span> (<a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">    <span class="stringliteral">&quot;../ini_files/typed_ini.conf&quot;</span>,</div>
<div class="line">    my_format,</div>
<div class="line">    my_init,</div>
<div class="line">    my_handler,</div>
<div class="line">    &amp;my_store</div>
<div class="line">  )) {</div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line">  }</div>
<div class="line">  print_stored_data(&amp;my_store);</div>
<div class="line">  free(my_store.my_section_my_string);</div>
<div class="line">  free((<span class="keywordtype">void</span> *) my_store.my_section_my_array);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html_a3a6eb3b79a88304864341075240ee412"><div class="ttname"><a href="confini_8h.html#a3a6eb3b79a88304864341075240ee412">ini_global_set_implicit_value</a></div><div class="ttdeci">void ini_global_set_implicit_value(char *const implicit_value, const size_t implicit_v_len)</div><div class="ttdoc">Set the value to be to be assigned to implicit keys.</div><div class="ttdef"><b>Definition:</b> confini.c:5395</div></div>
<div class="ttc" id="aconfini_8h_html_a4e394db479f56eaa830ade09c907461ba97333d01dfff8f9a9c690fc559751b45"><div class="ttname"><a href="confini_8h.html#a4e394db479f56eaa830ade09c907461ba97333d01dfff8f9a9c690fc559751b45">INI_KEY</a></div><div class="ttdeci">@ INI_KEY</div><div class="ttdef"><b>Definition:</b> confini.h:442</div></div>
<div class="ttc" id="aconfini_8h_html_a5d3460168636cfdffc6fb76be7c9b6b3"><div class="ttname"><a href="confini_8h.html#a5d3460168636cfdffc6fb76be7c9b6b3">ini_get_bool_i</a></div><div class="ttdeci">int ini_get_bool_i(const char *const ini_string, const int when_fail, const IniFormat format)</div><div class="ttdoc">Check whether an INI string matches one of the booleans listed in the private constant INI_BOOLEANS (...</div><div class="ttdef"><b>Definition:</b> confini.c:5550</div></div>
<div class="ttc" id="aconfini_8h_html_a6f7ff029dfae5a0e3bb5bc08f887bdcda37cb73b9bfc8bc6cc9d887108b4168bd"><div class="ttname"><a href="confini_8h.html#a6f7ff029dfae5a0e3bb5bc08f887bdcda37cb73b9bfc8bc6cc9d887108b4168bd">INI_IGNORE</a></div><div class="ttdeci">@ INI_IGNORE</div><div class="ttdef"><b>Definition:</b> confini.h:476</div></div>
<div class="ttc" id="aconfini_8h_html_adba0d5ee273d05ed845c66f01a621119"><div class="ttname"><a href="confini_8h.html#adba0d5ee273d05ed845c66f01a621119">ini_get_int</a></div><div class="ttdeci">int(*const ini_get_int)(const char *ini_string)</div><div class="ttdoc">Pointer to atoi()</div><div class="ttdef"><b>Definition:</b> confini.c:5733</div></div>
<div class="ttc" id="astructIniDispatch_html_a7f6ebc6713aae413c4157ce68008a8a8"><div class="ttname"><a href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">IniDispatch::type</a></div><div class="ttdeci">uint_least8_t type</div><div class="ttdef"><b>Definition:</b> confini.h:133</div></div>
<div class="ttc" id="astructIniDispatch_html_ae3aca4d49e430c9180b4f80b3f0624d9"><div class="ttname"><a href="structIniDispatch.html#ae3aca4d49e430c9180b4f80b3f0624d9">IniDispatch::append_to</a></div><div class="ttdeci">const char * append_to</div><div class="ttdef"><b>Definition:</b> confini.h:136</div></div>
<div class="ttc" id="astructIniFormat_html_a4d9984334335612830eef223e0adc913"><div class="ttname"><a href="structIniFormat.html#a4d9984334335612830eef223e0adc913">IniFormat::hash_marker</a></div><div class="ttdeci">unsigned char hash_marker</div><div class="ttdef"><b>Definition:</b> confini.h:115</div></div>
<div class="ttc" id="astructIniFormat_html_aab0c2bf1e89593bbbfc9ac5fc5f6f552"><div class="ttname"><a href="structIniFormat.html#aab0c2bf1e89593bbbfc9ac5fc5f6f552">IniFormat::semicolon_marker</a></div><div class="ttdeci">unsigned char semicolon_marker</div><div class="ttdef"><b>Definition:</b> confini.h:115</div></div>
<div class="ttc" id="astructIniFormat_html_ab5937aaf72b0ce5b62aece8d23ad7b82"><div class="ttname"><a href="structIniFormat.html#ab5937aaf72b0ce5b62aece8d23ad7b82">IniFormat::disabled_can_be_implicit</a></div><div class="ttdeci">unsigned char disabled_can_be_implicit</div><div class="ttdef"><b>Definition:</b> confini.h:115</div></div>
<div class="ttc" id="astructIniFormat_html_ae5722efd535f1d27c624a927eea622c3"><div class="ttname"><a href="structIniFormat.html#ae5722efd535f1d27c624a927eea622c3">IniFormat::implicit_is_not_empty</a></div><div class="ttdeci">unsigned char implicit_is_not_empty</div><div class="ttdef"><b>Definition:</b> confini.h:115</div></div>
<div class="ttc" id="astructIniStatistics_html"><div class="ttname"><a href="structIniStatistics.html">IniStatistics</a></div><div class="ttdoc">Global statistics about an INI file.</div><div class="ttdef"><b>Definition:</b> confini.h:121</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="a5d3460168636cfdffc6fb76be7c9b6b3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5d3460168636cfdffc6fb76be7c9b6b3">&#9670;&nbsp;</a></span>ini_get_bool_i()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int ini_get_bool_i </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int&#160;</td>
          <td class="paramname"><em>when_fail</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Check whether an INI string matches one of the booleans listed in the private constant <a class="el" href="confini_8c.html#afdb9fd02d693536253da07f0f468aaef" title="A list of possible string representations of boolean pairs.">INI_BOOLEANS</a> (case-insensitive) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>A string to check (it can be <code>NULL</code>) </td></tr>
    <tr><td class="paramname">when_fail</td><td>The value that is returned if no matching boolean is found </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The matching boolean (<code>0</code> or <code>1</code>) or <code>when_fail</code> if <code>ini_string</code> does not contain a valid INI boolean</dd></dl>
<p>Usually <code>ini_string</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well).</p>
<p>The <code>format</code> argument is used for the following fields:</p>
<ul>
<li><code>format.no_double_quotes</code></li>
<li><code>format.no_single_quotes</code></li>
</ul>
<div class="fragment"><div class="line"><span class="comment">/*  examples/miscellanea/typed_ini.c  */</span></div>
<div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">The following code will try to read an INI section called `my_section`,</span></div>
<div class="line"><span class="comment">expected to contain the following typed data:</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.ini}</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">[my_section]</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">my_string = [string]</span></div>
<div class="line"><span class="comment">my_number = [number]</span></div>
<div class="line"><span class="comment">my_boolean = [boolean]</span></div>
<div class="line"><span class="comment">my_implicit_boolean</span></div>
<div class="line"><span class="comment">my_array = [comma-delimited array]</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">No errors will be generated if any of the data above are absent.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;../utilities/make_strarray.h&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#define MY_ARRAY_DELIMITER &#39;,&#39;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">/*  My stored data  */</span></div>
<div class="line"><span class="keyword">struct </span>ini_store {</div>
<div class="line">  <span class="keywordtype">char</span> * my_section_my_string;</div>
<div class="line">  <span class="keywordtype">int</span> my_section_my_number;</div>
<div class="line">  <span class="keywordtype">bool</span> my_section_my_boolean;</div>
<div class="line">  <span class="keywordtype">bool</span> my_section_my_implicit_bool;</div>
<div class="line">  <span class="keywordtype">char</span> * <span class="keyword">const</span> * my_section_my_array;</div>
<div class="line">  <span class="keywordtype">size_t</span> my_section_my_arr_len;</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_init (<a class="code" href="structIniStatistics.html">IniStatistics</a> * statistics, <span class="keywordtype">void</span> * v_store) {</div>
<div class="line">  *((<span class="keyword">struct </span>ini_store *) v_store) = (<span class="keyword">struct </span>ini_store) {</div>
<div class="line">    .my_section_my_string = NULL,</div>
<div class="line">    .my_section_my_number = -1,</div>
<div class="line">    .my_section_my_boolean = <span class="keyword">false</span>,</div>
<div class="line">    .my_section_my_implicit_bool = <span class="keyword">false</span>,</div>
<div class="line">    .my_section_my_array = NULL,</div>
<div class="line">    .my_section_my_arr_len = 0</div>
<div class="line">  };</div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_handler (<a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dsp, <span class="keywordtype">void</span> * <span class="keyword">const</span> v_store) {</div>
<div class="line"><span class="preprocessor">  #define store ((struct ini_store *) v_store)</span></div>
<div class="line"><span class="preprocessor">  #define THEYMATCH(SSTR, ISTR) \</span></div>
<div class="line"><span class="preprocessor">    ini_string_match_si(SSTR, ISTR, dsp-&gt;format)</span></div>
<div class="line">  <span class="keywordflow">if</span> (dsp-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a> == <a class="code" href="confini_8h.html#a4e394db479f56eaa830ade09c907461ba97333d01dfff8f9a9c690fc559751b45">INI_KEY</a> &amp;&amp; THEYMATCH(<span class="stringliteral">&quot;my_section&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#ae3aca4d49e430c9180b4f80b3f0624d9">append_to</a>)) {</div>
<div class="line">    <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_string&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      dsp-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a> = <a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>);</div>
<div class="line">      <span class="comment">/*  Free previous duplicate key (if any)  */</span></div>
<div class="line">      free(store-&gt;my_section_my_string);</div>
<div class="line">      <span class="comment">/*  Allocate the new string  */</span></div>
<div class="line">      store-&gt;my_section_my_string = strndup(dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, dsp-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a>);</div>
<div class="line">      <span class="keywordflow">if</span> (!store-&gt;my_section_my_string) {</div>
<div class="line">        <span class="keywordflow">return</span> 1;</div>
<div class="line">      }</div>
<div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_number&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      store-&gt;my_section_my_number = <a class="code" href="confini_8h.html#adba0d5ee273d05ed845c66f01a621119">ini_get_int</a>(dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>);</div>
<div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_boolean&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      store-&gt;my_section_my_boolean = <a class="code" href="confini_8h.html#a5d3460168636cfdffc6fb76be7c9b6b3">ini_get_bool_i</a>(</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">        0,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">      );</div>
<div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_implicit_boolean&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      store-&gt;my_section_my_implicit_bool = <a class="code" href="confini_8h.html#a5d3460168636cfdffc6fb76be7c9b6b3">ini_get_bool_i</a>(</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">        1,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">      );</div>
<div class="line">    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (THEYMATCH(<span class="stringliteral">&quot;my_array&quot;</span>, dsp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>)) {</div>
<div class="line">      <span class="comment">/*  Save memory (not strictly needed)  */</span></div>
<div class="line">      dsp-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a> = <a class="code" href="confini_8h.html#aa0721fcae5f04e5a9edd485dc1ddd2fa">ini_array_collapse</a>(</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">        MY_ARRAY_DELIMITER,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">      );</div>
<div class="line">      <span class="comment">/*  Free previous duplicate key (if any)  */</span></div>
<div class="line">      free((<span class="keywordtype">void</span> *) store-&gt;my_section_my_array);</div>
<div class="line">      <span class="comment">/*  Allocate a new array of strings  */</span></div>
<div class="line">      <span class="comment">/*  Function in examples/utilities/make_strarray.h  */</span></div>
<div class="line">      store-&gt;my_section_my_array = make_strarray(</div>
<div class="line">        &amp;store-&gt;my_section_my_arr_len,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#a67b4c4b61e3c801cbfbcca95073ce864">v_len</a>,</div>
<div class="line">        MY_ARRAY_DELIMITER,</div>
<div class="line">        dsp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a></div>
<div class="line">      );</div>
<div class="line">      <span class="keywordflow">if</span> (!store-&gt;my_section_my_array) {</div>
<div class="line">        <span class="keywordflow">return</span> 1;</div>
<div class="line">      }</div>
<div class="line">    }</div>
<div class="line">  }</div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"><span class="preprocessor">  #undef THEYMATCH</span></div>
<div class="line"><span class="preprocessor">  #undef store</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> print_stored_data (<span class="keyword">const</span> <span class="keyword">struct</span> ini_store * <span class="keyword">const</span> store) {</div>
<div class="line">  printf(</div>
<div class="line">    <span class="stringliteral">&quot;my_string -&gt; %s\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;my_number -&gt; %d\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;my_boolean -&gt; %s\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;my_implicit_boolean -&gt; %s\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;my_array[%zu] -&gt; [%s&quot;</span>,</div>
<div class="line">    store-&gt;my_section_my_string,</div>
<div class="line">    store-&gt;my_section_my_number,</div>
<div class="line">    store-&gt;my_section_my_boolean ? <span class="stringliteral">&quot;True (`1`)&quot;</span> : <span class="stringliteral">&quot;False (`0`)&quot;</span>,</div>
<div class="line">    store-&gt;my_section_my_implicit_bool ? <span class="stringliteral">&quot;True (`1`)&quot;</span> : <span class="stringliteral">&quot;False (`0`)&quot;</span>,</div>
<div class="line">    store-&gt;my_section_my_arr_len,</div>
<div class="line">    store-&gt;my_section_my_arr_len ? store-&gt;my_section_my_array[0] : <span class="stringliteral">&quot;&quot;</span></div>
<div class="line">  );</div>
<div class="line">  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> idx = 1; idx &lt; store-&gt;my_section_my_arr_len; idx++) {</div>
<div class="line">    printf(<span class="stringliteral">&quot;|%s&quot;</span>, store-&gt;my_section_my_array[idx]);</div>
<div class="line">  }</div>
<div class="line">  printf(<span class="stringliteral">&quot;]\n&quot;</span>);</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line">  <a class="code" href="structIniFormat.html">IniFormat</a> my_format;</div>
<div class="line">  <span class="keyword">struct </span>ini_store my_store;</div>
<div class="line">  <a class="code" href="confini_8h.html#a3a6eb3b79a88304864341075240ee412">ini_global_set_implicit_value</a>(<span class="stringliteral">&quot;YES&quot;</span>, 3);</div>
<div class="line">  my_format = <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>;</div>
<div class="line">  my_format.<a class="code" href="structIniFormat.html#ae5722efd535f1d27c624a927eea622c3">implicit_is_not_empty</a> = <span class="keyword">true</span>;</div>
<div class="line">  my_format.<a class="code" href="structIniFormat.html#ab5937aaf72b0ce5b62aece8d23ad7b82">disabled_can_be_implicit</a> = <span class="keyword">true</span>;</div>
<div class="line">  my_format.<a class="code" href="structIniFormat.html#aab0c2bf1e89593bbbfc9ac5fc5f6f552">semicolon_marker</a> = my_format.<a class="code" href="structIniFormat.html#a4d9984334335612830eef223e0adc913">hash_marker</a> = <a class="code" href="confini_8h.html#a6f7ff029dfae5a0e3bb5bc08f887bdcda37cb73b9bfc8bc6cc9d887108b4168bd">INI_IGNORE</a>;</div>
<div class="line">  <span class="keywordflow">if</span> (<a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">    <span class="stringliteral">&quot;../ini_files/typed_ini.conf&quot;</span>,</div>
<div class="line">    my_format,</div>
<div class="line">    my_init,</div>
<div class="line">    my_handler,</div>
<div class="line">    &amp;my_store</div>
<div class="line">  )) {</div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line">  }</div>
<div class="line">  print_stored_data(&amp;my_store);</div>
<div class="line">  free(my_store.my_section_my_string);</div>
<div class="line">  free((<span class="keywordtype">void</span> *) my_store.my_section_my_array);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line">}</div>
<div class="line"> </div>
</div><!-- fragment --> 
</div>
</div>
<a id="a3a6eb3b79a88304864341075240ee412"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3a6eb3b79a88304864341075240ee412">&#9670;&nbsp;</a></span>ini_global_set_implicit_value()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ini_global_set_implicit_value </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>implicit_value</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>implicit_v_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the value to be to be assigned to implicit keys. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">implicit_value</td><td>The string to be used as implicit value (usually <code>"YES"</code>, <code>"TRUE"</code>, or <code>"ON"</code>, or any other string; it can be <code>NULL</code>) </td></tr>
    <tr><td class="paramname">implicit_v_len</td><td>The length of <code>implicit_value</code> (without counting the NUL terminator; use <code>0</code> for both an empty string and <code>NULL</code>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Nothing</dd></dl>
<dl class="section warning"><dt>Warning</dt><dd>This function changes the value of one or more global variables. In order to be thread-safe this function should be used only once at beginning of execution, or otherwise a mutex logic must be introduced.</dd></dl>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_global_set_implicit_value.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> ini_listener (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a> == <a class="code" href="confini_8h.html#a243b229193f154746a9fbfbdb02689bf">INI_GLOBAL_IMPLICIT_VALUE</a>) {</div>
<div class="line"> </div>
<div class="line">    printf(</div>
<div class="line">      <span class="stringliteral">&quot;\nDATA: %s\nVALUE: %s\nNODE TYPE: %u\n&quot;</span></div>
<div class="line">      <span class="stringliteral">&quot;(This is an implicit key element)\n&quot;</span>,</div>
<div class="line"> </div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a></div>
<div class="line">    );</div>
<div class="line"> </div>
<div class="line">  } <span class="keywordflow">else</span> {</div>
<div class="line"> </div>
<div class="line">    printf(</div>
<div class="line">      <span class="stringliteral">&quot;\nDATA: %s\nVALUE: %s\nNODE TYPE: %u\n&quot;</span>,</div>
<div class="line"> </div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">      dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a></div>
<div class="line">    );</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <a class="code" href="structIniFormat.html">IniFormat</a> my_format = <a class="code" href="confini_8h.html#a724e3c7be7055b35bccb080f748868b5">INI_UNIXLIKE_FORMAT</a>;</div>
<div class="line"> </div>
<div class="line">  <a class="code" href="confini_8h.html#a3a6eb3b79a88304864341075240ee412">ini_global_set_implicit_value</a>(<span class="stringliteral">&quot;[implicit default value]&quot;</span>, 24);</div>
<div class="line"> </div>
<div class="line">  <span class="comment">/*  Without this implicit keys will be considered empty  */</span></div>
<div class="line">  my_format.<a class="code" href="structIniFormat.html#ae5722efd535f1d27c624a927eea622c3">implicit_is_not_empty</a> = <span class="keyword">true</span>;</div>
<div class="line">  my_format.<a class="code" href="structIniFormat.html#ab5937aaf72b0ce5b62aece8d23ad7b82">disabled_can_be_implicit</a> = <span class="keyword">true</span>;</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">      <span class="stringliteral">&quot;../ini_files/unix-like.conf&quot;</span>,</div>
<div class="line">      my_format,</div>
<div class="line">      NULL,</div>
<div class="line">      ini_listener,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html_a243b229193f154746a9fbfbdb02689bf"><div class="ttname"><a href="confini_8h.html#a243b229193f154746a9fbfbdb02689bf">INI_GLOBAL_IMPLICIT_VALUE</a></div><div class="ttdeci">char * INI_GLOBAL_IMPLICIT_VALUE</div><div class="ttdoc">Value to be assigned to implicit keys (default value: NULL)</div><div class="ttdef"><b>Definition:</b> confini.c:5764</div></div>
<div class="ttc" id="aconfini_8h_html_a724e3c7be7055b35bccb080f748868b5"><div class="ttname"><a href="confini_8h.html#a724e3c7be7055b35bccb080f748868b5">INI_UNIXLIKE_FORMAT</a></div><div class="ttdeci">static const IniFormat INI_UNIXLIKE_FORMAT</div><div class="ttdoc">A model format for Unix-like .conf files (where space characters are delimiters between keys and valu...</div><div class="ttdef"><b>Definition:</b> confini.h:532</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="a2d22fde4b4093871bcc498c2bddc7fbe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d22fde4b4093871bcc498c2bddc7fbe">&#9670;&nbsp;</a></span>ini_global_set_lowercase_mode()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ini_global_set_lowercase_mode </td>
          <td>(</td>
          <td class="paramtype">const bool&#160;</td>
          <td class="paramname"><em>lowercase</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the value of the global variable <a class="el" href="confini_8c.html#a44d7de5e7bb75d40d31832a82b66891d" title="If set to true, key and section names in case-insensitive INI formats will be dispatched lowercase,...">INI_GLOBAL_LOWERCASE_MODE</a>. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>Deprecated since version 1.15.0 (it will be removed in version 2.0.0) </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">lowercase</td><td>The new value </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Nothing</dd></dl>
<p>If <code>lowercase</code> is <code>true</code>, key and section names in case-insensitive INI formats will be dispatched lowercase, verbatim otherwise (default value: <code>true</code>).</p>
<dl class="section warning"><dt>Warning</dt><dd>This function changes the value of one or more global variables. In order to be thread-safe this function should be used only once at beginning of execution, or otherwise a mutex logic must be introduced. </dd></dl>

</div>
</div>
<a id="ab4f3def0b84486ca2154673f339763fa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab4f3def0b84486ca2154673f339763fa">&#9670;&nbsp;</a></span>ini_ntof()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structIniFormat.html">IniFormat</a> ini_ntof </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="confini_8h.html#a47a6a31dd11db39ac287147955733511">IniFormatNum</a>&#160;</td>
          <td class="paramname"><em>format_num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Construct a new <a class="el" href="structIniFormat.html" title="24-bit bitfield representing the format of an INI file (INI dialect)">IniFormat</a> according to an <a class="el" href="confini_8h.html#a47a6a31dd11db39ac287147955733511" title="The unique ID of an INI format (24-bit maximum)">IniFormatNum</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">format_num</td><td>The <a class="el" href="confini_8h.html#a47a6a31dd11db39ac287147955733511" title="The unique ID of an INI format (24-bit maximum)">IniFormatNum</a> to parse </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new <a class="el" href="structIniFormat.html" title="24-bit bitfield representing the format of an INI file (INI dialect)">IniFormat</a> constructed</dd></dl>
<dl class="section note"><dt>Note</dt><dd>If <code>format_num</code> <code>&gt;</code> <code>16777215</code> it will be truncated to 24 bits. </dd></dl>

</div>
</div>
<a id="a731857502fa7f8e31c4a024335a6d5d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a731857502fa7f8e31c4a024335a6d5d6">&#9670;&nbsp;</a></span>ini_string_match_ii()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ini_string_match_ii </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>ini_string_a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>ini_string_b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compare two INI strings and check whether they match. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string_a</td><td>The first INI string unescaped according to <code>format</code> </td></tr>
    <tr><td class="paramname">ini_string_b</td><td>The second INI string unescaped according to <code>format</code> </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A boolean: <code>true</code> if the two strings match, <code>false</code> otherwise</dd></dl>
<p>This function grants that the result of the comparison between two INI strings</p>
<div class="fragment"><div class="line">printf(</div>
<div class="line">    <span class="stringliteral">&quot;%s\n&quot;</span>,</div>
<div class="line">    <a class="code" href="confini_8h.html#a731857502fa7f8e31c4a024335a6d5d6">ini_string_match_ii</a>(my_ini_string_1, my_ini_string_2, format) ?</div>
<div class="line">        <span class="stringliteral">&quot;They match&quot;</span></div>
<div class="line">    :</div>
<div class="line">        <span class="stringliteral">&quot;They don&#39;t match&quot;</span></div>
<div class="line">);</div>
<div class="ttc" id="aconfini_8h_html_a731857502fa7f8e31c4a024335a6d5d6"><div class="ttname"><a href="confini_8h.html#a731857502fa7f8e31c4a024335a6d5d6">ini_string_match_ii</a></div><div class="ttdeci">bool ini_string_match_ii(const char *const ini_string_a, const char *const ini_string_b, const IniFormat format)</div><div class="ttdoc">Compare two INI strings and check whether they match.</div><div class="ttdef"><b>Definition:</b> confini.c:3653</div></div>
</div><!-- fragment --><p>will always match the result of the <em>literal</em> comparison between the same two INI strings after these have been parsed by <a class="el" href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3" title="Unescape \&#39;, \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...">ini_string_parse()</a> when <code>format.do_not_collapse_values</code> is set to <code>false</code>.</p>
<div class="fragment"><div class="line"><a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(my_ini_string_1, format);</div>
<div class="line"><a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(my_ini_string_2, format);</div>
<div class="line"> </div>
<div class="line">printf(<span class="stringliteral">&quot;%s\n&quot;</span>,</div>
<div class="line">    <a class="code" href="confini_8h.html#a8bb35677b6e7c201eb1fe83efee99d9a">ini_string_match_ss</a>(my_ini_string_1, my_ini_string_2, format) ?</div>
<div class="line">        <span class="stringliteral">&quot;They match&quot;</span></div>
<div class="line">    :</div>
<div class="line">        <span class="stringliteral">&quot;They don&#39;t match&quot;</span></div>
<div class="line">);</div>
<div class="ttc" id="aconfini_8h_html_a8bb35677b6e7c201eb1fe83efee99d9a"><div class="ttname"><a href="confini_8h.html#a8bb35677b6e7c201eb1fe83efee99d9a">ini_string_match_ss</a></div><div class="ttdeci">bool ini_string_match_ss(const char *const simple_string_a, const char *const simple_string_b, const IniFormat format)</div><div class="ttdoc">Compare two simple strings and check whether they match.</div><div class="ttdef"><b>Definition:</b> confini.c:3369</div></div>
</div><!-- fragment --><p>INI strings are the strings typically dispatched by <a class="el" href="confini_8c.html#a7d5042d3044dfb5a34a6bfc5af3a882d" title="Parse an INI file and dispatch its content to a custom callback using a FILE structure as argument.">load_ini_file()</a>, <a class="el" href="confini_8c.html#a54be108d26619db3066ce1c000dc8a17" title="Parse an INI file and dispatch its content to a custom callback using a path as argument.">load_ini_path()</a> or <a class="el" href="confini_8c.html#a25d648d387f6e8bc36e7965accfca63b" title="Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback.">strip_ini_cache()</a>, which may contain quotes and the three escape sequences <code>\\</code>, <code>\'</code> and <code>\&quot;</code>.</p>
<p>In order to be suitable for both names and values, <b>this function always considers sequences of one or more spaces out of quotes in both strings as collapsed</b>, even when <code>format.do_not_collapse_values</code> is set to <code>true</code>.</p>
<p>The <code>format</code> argument is used for the following fields:</p>
<ul>
<li><code>format.case_sensitive</code></li>
<li><code>format.no_double_quotes</code></li>
<li><code>format.no_single_quotes</code></li>
<li><code>format.multiline_nodes</code> (<code><a class="el" href="confini_8h.html#ae74cb0104512ee3dfe2865abe689e3f5" title="Check whether a format does not support escape sequences.">INIFORMAT_HAS_NO_ESC()</a></code>) </li>
</ul>

</div>
</div>
<a id="a5773ae8cbe4ce15737dcece84b362fa0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5773ae8cbe4ce15737dcece84b362fa0">&#9670;&nbsp;</a></span>ini_string_match_si()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ini_string_match_si </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>simple_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compare a simple string and an INI string and and check whether they match. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The INI string escaped according to <code>format</code> </td></tr>
    <tr><td class="paramname">simple_string</td><td>The simple string </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A boolean: <code>true</code> if the two strings match, <code>false</code> otherwise</dd></dl>
<p>This function grants that the result of the comparison between a simple string and an INI string</p>
<div class="fragment"><div class="line">printf(</div>
<div class="line">    <span class="stringliteral">&quot;%s\n&quot;</span>,</div>
<div class="line">    <a class="code" href="confini_8h.html#a5773ae8cbe4ce15737dcece84b362fa0">ini_string_match_si</a>(my_simple_string, my_ini_string, format) ?</div>
<div class="line">        <span class="stringliteral">&quot;They match&quot;</span></div>
<div class="line">    :</div>
<div class="line">        <span class="stringliteral">&quot;They don&#39;t match&quot;</span></div>
<div class="line">);</div>
</div><!-- fragment --><p>will always match the result of the <em>literal</em> comparison between the simple string and the INI string after the latter has been parsed by <a class="el" href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3" title="Unescape \&#39;, \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...">ini_string_parse()</a> when <code>format.do_not_collapse_values</code> is set to <code>false</code>.</p>
<div class="fragment"><div class="line"><a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(my_ini_string, format);</div>
<div class="line"> </div>
<div class="line">printf(</div>
<div class="line">    <span class="stringliteral">&quot;%s\n&quot;</span>,</div>
<div class="line">    <a class="code" href="confini_8h.html#a8bb35677b6e7c201eb1fe83efee99d9a">ini_string_match_ss</a>(my_simple_string, my_ini_string, format) ?</div>
<div class="line">        <span class="stringliteral">&quot;They match&quot;</span></div>
<div class="line">    :</div>
<div class="line">        <span class="stringliteral">&quot;They don&#39;t match&quot;</span></div>
<div class="line">);</div>
</div><!-- fragment --><p>INI strings are the strings typically dispatched by <a class="el" href="confini_8c.html#a7d5042d3044dfb5a34a6bfc5af3a882d" title="Parse an INI file and dispatch its content to a custom callback using a FILE structure as argument.">load_ini_file()</a>, <a class="el" href="confini_8c.html#a54be108d26619db3066ce1c000dc8a17" title="Parse an INI file and dispatch its content to a custom callback using a path as argument.">load_ini_path()</a> or <a class="el" href="confini_8c.html#a25d648d387f6e8bc36e7965accfca63b" title="Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback.">strip_ini_cache()</a>, which may contain quotes and the three escape sequences <code>\\</code>, <code>\'</code> and <code>\&quot;</code>. Simple strings are user-given strings or the result of <a class="el" href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3" title="Unescape \&#39;, \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...">ini_string_parse()</a>.</p>
<p>In order to be suitable for both names and values, <b>this function always considers sequences of one or more spaces out of quotes in the INI string as collapsed</b>, even when <code>format.do_not_collapse_values</code> is set to <code>true</code>.</p>
<p>The <code>format</code> argument is used for the following fields:</p>
<ul>
<li><code>format.case_sensitive</code></li>
<li><code>format.no_double_quotes</code></li>
<li><code>format.no_single_quotes</code></li>
<li><code>format.multiline_nodes</code> (<code><a class="el" href="confini_8h.html#ae74cb0104512ee3dfe2865abe689e3f5" title="Check whether a format does not support escape sequences.">INIFORMAT_HAS_NO_ESC()</a></code>)</li>
</ul>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_string_match_si.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> passfinder (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> disp,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_membid</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  <span class="comment">/*  Search for `password = &quot;hello world&quot;` in the INI file  */</span></div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a5773ae8cbe4ce15737dcece84b362fa0">ini_string_match_si</a>(<span class="stringliteral">&quot;password&quot;</span>, disp-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>, disp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>) &amp;&amp;</div>
<div class="line">    <a class="code" href="confini_8h.html#a5773ae8cbe4ce15737dcece84b362fa0">ini_string_match_si</a>(<span class="stringliteral">&quot;hello world&quot;</span>, disp-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, disp-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>)</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    *((<span class="keywordtype">size_t</span> *) v_membid) = disp-&gt;<a class="code" href="structIniDispatch.html#a795864cff55f67498aa22722c17fc6d2">dispatch_id</a>;</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordtype">size_t</span> membid;</div>
<div class="line"> </div>
<div class="line">  <span class="comment">/*  Load INI file  */</span></div>
<div class="line">  <span class="keywordtype">int</span> retval = <a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">    <span class="stringliteral">&quot;../ini_files/self_explaining.conf&quot;</span>,</div>
<div class="line">    <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">    NULL,</div>
<div class="line">    passfinder,</div>
<div class="line">    &amp;membid</div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  <span class="comment">/*  Check for errors  */</span></div>
<div class="line">  <span class="keywordflow">if</span> (retval &amp; <a class="code" href="confini_8h.html#a0b9dcb5c0711475ea78b065b0322bde1">CONFINI_ERROR</a>) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="comment">/*  Check if parsing has been interrupted by `passfinder()`  */</span></div>
<div class="line">  retval  ==  <a class="code" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a133a335ff201d93015a27bd581e6b399">CONFINI_FEINTR</a> ?</div>
<div class="line">                printf(</div>
<div class="line">                  <span class="stringliteral">&quot;We found it! It&#39;s the INI node number %zu!\n&quot;</span>,</div>
<div class="line">                  membid</div>
<div class="line">                )</div>
<div class="line">              :</div>
<div class="line">                printf(<span class="stringliteral">&quot;We didn&#39;t find it :-(\n&quot;</span>);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html_a0b9dcb5c0711475ea78b065b0322bde1"><div class="ttname"><a href="confini_8h.html#a0b9dcb5c0711475ea78b065b0322bde1">CONFINI_ERROR</a></div><div class="ttdeci">#define CONFINI_ERROR</div><div class="ttdoc">Error mask (flags not present in user-generated interruptions)</div><div class="ttdef"><b>Definition:</b> confini.h:398</div></div>
<div class="ttc" id="aconfini_8h_html_a4b42cb63e48154fb799599eccd25ce29a133a335ff201d93015a27bd581e6b399"><div class="ttname"><a href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a133a335ff201d93015a27bd581e6b399">CONFINI_FEINTR</a></div><div class="ttdeci">@ CONFINI_FEINTR</div><div class="ttdef"><b>Definition:</b> confini.h:409</div></div>
<div class="ttc" id="astructIniDispatch_html_a795864cff55f67498aa22722c17fc6d2"><div class="ttname"><a href="structIniDispatch.html#a795864cff55f67498aa22722c17fc6d2">IniDispatch::dispatch_id</a></div><div class="ttdeci">size_t dispatch_id</div><div class="ttdef"><b>Definition:</b> confini.h:140</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="a8bb35677b6e7c201eb1fe83efee99d9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8bb35677b6e7c201eb1fe83efee99d9a">&#9670;&nbsp;</a></span>ini_string_match_ss()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool ini_string_match_ss </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>simple_string_a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>simple_string_b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Compare two simple strings and check whether they match. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">simple_string_a</td><td>The first simple string </td></tr>
    <tr><td class="paramname">simple_string_b</td><td>The second simple string </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A boolean: <code>true</code> if the two strings match, <code>false</code> otherwise</dd></dl>
<p>Simple strings are user-given strings or the result of <a class="el" href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3" title="Unescape \&#39;, \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...">ini_string_parse()</a>. The <code>format</code> argument is used for the following fields:</p>
<ul>
<li><code>format.case_sensitive</code> </li>
</ul>

</div>
</div>
<a id="ab4e3d48f0eb0438ba0c84fc77e362aa3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab4e3d48f0eb0438ba0c84fc77e362aa3">&#9670;&nbsp;</a></span>ini_string_parse()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ini_string_parse </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unescape <code>\'</code>, <code>\&quot;</code>, and <code>\\</code> and remove all unescaped quotes (when single/double quotes are considered metacharacters in respect to the format given); if the format allows it, sequences of one or more spaces out of quotes will be collapsed. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The string to be unescaped </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string</dd></dl>
<p>This function is meant to be used to parse values. In order to parse key and section names please use <a class="el" href="confini_8c.html#ac55f3fab95f697ac5058533df100fc11" title="Unescape \&#39;, \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...">ini_unquote()</a>.</p>
<p>If you only need to compare <code>ini_string</code> with another string, consider to use <a class="el" href="confini_8c.html#a5773ae8cbe4ce15737dcece84b362fa0" title="Compare a simple string and an INI string and and check whether they match.">ini_string_match_si()</a> and <a class="el" href="confini_8c.html#a731857502fa7f8e31c4a024335a6d5d6" title="Compare two INI strings and check whether they match.">ini_string_match_ii()</a> instead of parsing the former and perform a simple comparison afterwards. These two functions are in fact able to check directly for equality between unparsed INI strings without actually modifying them.</p>
<p>Usually <code>ini_string</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well). If <code>format.do_not_collapse_values</code> is set to non-zero, spaces surrounding empty quotes will be collapsed together with the latter.</p>
<dl class="section note"><dt>Note</dt><dd>If <code>ini_string</code> comes from <a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf" title="Value to be assigned to implicit keys (default value: NULL)">INI_GLOBAL_IMPLICIT_VALUE</a> this function is no-op and will only return the value of <a class="el" href="confini_8c.html#acecf086ca074b27365e877f056af2192" title="Length of the value assigned to implicit keys (default value: 0)">INI_GLOBAL_IMPLICIT_V_LEN</a> minus the offset of <code>ini_string</code> within <a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf" title="Value to be assigned to implicit keys (default value: NULL)">INI_GLOBAL_IMPLICIT_VALUE</a>.</dd></dl>
<p>The <code>format</code> argument is used for the following fields:</p>
<ul>
<li><code>format.no_single_quotes</code></li>
<li><code>format.no_double_quotes</code></li>
<li><code>format.multiline_nodes</code> (<code><a class="el" href="confini_8h.html#ae74cb0104512ee3dfe2865abe689e3f5" title="Check whether a format does not support escape sequences.">INIFORMAT_HAS_NO_ESC()</a></code>)</li>
<li><code>format.do_not_collapse_values</code></li>
</ul>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_string_parse.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> ini_listener (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a> == <a class="code" href="confini_8h.html#a4e394db479f56eaa830ade09c907461ba97333d01dfff8f9a9c690fc559751b45">INI_KEY</a> || dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a> == <a class="code" href="confini_8h.html#a4e394db479f56eaa830ade09c907461ba9b68a1fa247c1b1ae3fc2ce615359c7b">INI_DISABLED_KEY</a></div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    <a class="code" href="confini_8h.html#ac55f3fab95f697ac5058533df100fc11">ini_unquote</a>(dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>);</div>
<div class="line">    <a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>);</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  printf(</div>
<div class="line">    <span class="stringliteral">&quot;DATA: %s\nVALUE: %s\nNODE TYPE: %u\n\n&quot;</span>,</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>,</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a></div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">      <span class="stringliteral">&quot;../ini_files/self_explaining.conf&quot;</span>,</div>
<div class="line">      <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">      NULL,</div>
<div class="line">      ini_listener,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="ttc" id="aconfini_8h_html_a4e394db479f56eaa830ade09c907461ba9b68a1fa247c1b1ae3fc2ce615359c7b"><div class="ttname"><a href="confini_8h.html#a4e394db479f56eaa830ade09c907461ba9b68a1fa247c1b1ae3fc2ce615359c7b">INI_DISABLED_KEY</a></div><div class="ttdeci">@ INI_DISABLED_KEY</div><div class="ttdef"><b>Definition:</b> confini.h:446</div></div>
<div class="ttc" id="aconfini_8h_html_ac55f3fab95f697ac5058533df100fc11"><div class="ttname"><a href="confini_8h.html#ac55f3fab95f697ac5058533df100fc11">ini_unquote</a></div><div class="ttdeci">size_t ini_unquote(char *const ini_string, const IniFormat format)</div><div class="ttdoc">Unescape \', \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...</div><div class="ttdef"><b>Definition:</b> confini.c:4110</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="ac55f3fab95f697ac5058533df100fc11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac55f3fab95f697ac5058533df100fc11">&#9670;&nbsp;</a></span>ini_unquote()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t ini_unquote </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>ini_string</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unescape <code>\'</code>, <code>\&quot;</code>, and <code>\\</code> and remove all unescaped quotes (when single/double quotes are considered metacharacters in respect to the format given) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The string to be unescaped </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string</dd></dl>
<p>This function is very similar to <a class="el" href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3" title="Unescape \&#39;, \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...">ini_string_parse()</a>, except that does not bother collapsing the sequences of more than one space that might result from removing empty quotes. Its purpose is to be used to parse key and section names, since these are always dispatched as already collapsed. In order to parse values, or array parts listed in values, please use <a class="el" href="confini_8c.html#ab4e3d48f0eb0438ba0c84fc77e362aa3" title="Unescape \&#39;, \&quot;, and \\ and remove all unescaped quotes (when single/double quotes are considered met...">ini_string_parse()</a>.</p>
<p>If you only need to compare <code>ini_string</code> with another string, consider to use <a class="el" href="confini_8c.html#a5773ae8cbe4ce15737dcece84b362fa0" title="Compare a simple string and an INI string and and check whether they match.">ini_string_match_si()</a> and <a class="el" href="confini_8c.html#a731857502fa7f8e31c4a024335a6d5d6" title="Compare two INI strings and check whether they match.">ini_string_match_ii()</a> instead of parsing the former and perform a simple comparison afterwards. These two functions are in fact able to check directly for equality between unparsed INI strings without actually modifiyng them.</p>
<p>Usually <code>ini_string</code> comes from an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> (but any other string may be used as well). If the string does not contain quotes, or if quotes are considered to be normal characters, no changes will be made.</p>
<dl class="section note"><dt>Note</dt><dd>If <code>ini_string</code> comes from <a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf" title="Value to be assigned to implicit keys (default value: NULL)">INI_GLOBAL_IMPLICIT_VALUE</a> this function is no-op and will only return the value of <a class="el" href="confini_8c.html#acecf086ca074b27365e877f056af2192" title="Length of the value assigned to implicit keys (default value: 0)">INI_GLOBAL_IMPLICIT_V_LEN</a> minus the offset of <code>ini_string</code> within <a class="el" href="confini_8c.html#a243b229193f154746a9fbfbdb02689bf" title="Value to be assigned to implicit keys (default value: NULL)">INI_GLOBAL_IMPLICIT_VALUE</a>.</dd></dl>
<p>The <code>format</code> argument is used for the following fields:</p>
<ul>
<li><code>format.no_single_quotes</code></li>
<li><code>format.no_double_quotes</code></li>
<li><code>format.multiline_nodes</code> (<code><a class="el" href="confini_8h.html#ae74cb0104512ee3dfe2865abe689e3f5" title="Check whether a format does not support escape sequences.">INIFORMAT_HAS_NO_ESC()</a></code>)</li>
</ul>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/ini_string_parse.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> ini_listener (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a> == <a class="code" href="confini_8h.html#a4e394db479f56eaa830ade09c907461ba97333d01dfff8f9a9c690fc559751b45">INI_KEY</a> || dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a> == <a class="code" href="confini_8h.html#a4e394db479f56eaa830ade09c907461ba9b68a1fa247c1b1ae3fc2ce615359c7b">INI_DISABLED_KEY</a></div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    <a class="code" href="confini_8h.html#ac55f3fab95f697ac5058533df100fc11">ini_unquote</a>(dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>);</div>
<div class="line">    <a class="code" href="confini_8h.html#ab4e3d48f0eb0438ba0c84fc77e362aa3">ini_string_parse</a>(dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#adfda221d4a9effcb4f3ee6a99c5f2de2">format</a>);</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  printf(</div>
<div class="line">    <span class="stringliteral">&quot;DATA: %s\nVALUE: %s\nNODE TYPE: %u\n\n&quot;</span>,</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>,</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>,</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a></div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">      <span class="stringliteral">&quot;../ini_files/self_explaining.conf&quot;</span>,</div>
<div class="line">      <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">      NULL,</div>
<div class="line">      ini_listener,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
</div><!-- fragment --> 
</div>
</div>
<a id="a02b2b22a18125d04b08e553f23b110d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a02b2b22a18125d04b08e553f23b110d4">&#9670;&nbsp;</a></span>is_some_space()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static unsigned char is_some_space </td>
          <td>(</td>
          <td class="paramtype">const char&#160;</td>
          <td class="paramname"><em>chr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int_least8_t&#160;</td>
          <td class="paramname"><em>depth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Check whether a character is a space. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">chr</td><td>The target character </td></tr>
    <tr><td class="paramname">depth</td><td>What is actually considered a space (possible values: <code>_CONFINI_WITH_EOL_</code>, <code>_CONFINI_NO_EOL_</code>, <code>_CONFINI_JUST_S_T_</code>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A boolean: <code>true</code> if the character matches, <code>false</code> otherwise </dd></dl>

</div>
</div>
<a id="a7d5042d3044dfb5a34a6bfc5af3a882d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7d5042d3044dfb5a34a6bfc5af3a882d">&#9670;&nbsp;</a></span>load_ini_file()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int load_ini_file </td>
          <td>(</td>
          <td class="paramtype">FILE *const&#160;</td>
          <td class="paramname"><em>ini_file</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="confini_8h.html#a3330e1083693c66b63b18c0d8883f9a8">IniStatsHandler</a>&#160;</td>
          <td class="paramname"><em>f_init</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="confini_8h.html#a0eff1cb87db5b73071e87f8cc9c4b445">IniDispHandler</a>&#160;</td>
          <td class="paramname"><em>f_foreach</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *const&#160;</td>
          <td class="paramname"><em>user_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse an INI file and dispatch its content to a custom callback using a <code>FILE</code> structure as argument. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_file</td><td>The <code>FILE</code> handle pointing to the INI file to parse </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
    <tr><td class="paramname">f_init</td><td>The function that will be invoked before the first dispatch, or <code>NULL</code> </td></tr>
    <tr><td class="paramname">f_foreach</td><td>The function that will be invoked for each dispatch, or <code>NULL</code> </td></tr>
    <tr><td class="paramname">user_data</td><td>A custom argument, or <code>NULL</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero for success, otherwise an error code (see <code>enum</code> <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29" title="Error codes.">ConfiniInterruptNo</a>)</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function is absent if the <code>--without-io-api</code> option was passed to the <code>configure</code> script when the library was compiled</dd></dl>
<p>The <code>ini_file</code> parameter must be a <code>FILE</code> handle with read privileges. On some platforms, such as Microsoft Windows, it might be necessary to add the binary specifier to the mode string (<code>"b"</code>) in order to prevent discrepancies between the physical size of the file and its computed size. Adding the binary specifier guarantees portability across all platforms:</p>
<div class="fragment"><div class="line">FILE * my_file = fopen(<span class="stringliteral">&quot;example.conf&quot;</span>, <span class="stringliteral">&quot;rb&quot;</span>);</div>
</div><!-- fragment --><p>For the two parameters <code>f_init</code> and <code>f_foreach</code> see function <a class="el" href="confini_8c.html#a25d648d387f6e8bc36e7965accfca63b" title="Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback.">strip_ini_cache()</a>.</p>
<p>The parsing algorithms used by <b>libconfini</b> are able to parse any type of file encoded in 8-bit code units, as long as the characters that match the regular expression <code>/[\s\[\]\.\\;#"']/</code> refer to the same code points they refer to in ASCII (as they do, for example, in UTF-8 and ISO-8859-1), independently of platform-specific conventions.</p>
<dl class="section note"><dt>Note</dt><dd>In order to be null-byte-injection safe, <code>NUL</code> characters, if present in the file, will be removed from the dispatched strings.</dd></dl>
<p>Possible return values are: <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29ab6180fd6db09408e11eb1c27fb7028e7">CONFINI_SUCCESS</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a1435b36fb0e428e18c5f6a32408eb3ea">CONFINI_IINTR</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a133a335ff201d93015a27bd581e6b399">CONFINI_FEINTR</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a0e8e1cee80bc4b7839838764f5d661f5">CONFINI_ENOMEM</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a8b9b6ea5c455bfad3976fd394c36a91d">CONFINI_EIO</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a82e26058d2b7bb2203fe321d0320d98a">CONFINI_EOOR</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29abea4607cf9d97028cd782ceb2885b2d9">CONFINI_EBADF</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a20bea3ecf7dd504f5446a5983ed3fc0d">CONFINI_EFBIG</a>.</p>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/load_ini_file.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_callback (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  printf(</div>
<div class="line">    <span class="stringliteral">&quot;DATA: %s\nVALUE: %s\nNODE TYPE: %u\n\n&quot;</span>,</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a></div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  FILE * <span class="keyword">const</span> ini_file = fopen(<span class="stringliteral">&quot;../ini_files/delivery.conf&quot;</span>, <span class="stringliteral">&quot;rb&quot;</span>);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (ini_file == NULL) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;File doesn&#39;t exist :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a7d5042d3044dfb5a34a6bfc5af3a882d">load_ini_file</a>(</div>
<div class="line">      ini_file,</div>
<div class="line">      <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">      NULL,</div>
<div class="line">      my_callback,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  fclose(ini_file);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html_a7d5042d3044dfb5a34a6bfc5af3a882d"><div class="ttname"><a href="confini_8h.html#a7d5042d3044dfb5a34a6bfc5af3a882d">load_ini_file</a></div><div class="ttdeci">int load_ini_file(FILE *const ini_file, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)</div><div class="ttdoc">Parse an INI file and dispatch its content to a custom callback using a FILE structure as argument.</div><div class="ttdef"><b>Definition:</b> confini.c:3180</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="a54be108d26619db3066ce1c000dc8a17"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a54be108d26619db3066ce1c000dc8a17">&#9670;&nbsp;</a></span>load_ini_path()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int load_ini_path </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="confini_8h.html#a3330e1083693c66b63b18c0d8883f9a8">IniStatsHandler</a>&#160;</td>
          <td class="paramname"><em>f_init</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="confini_8h.html#a0eff1cb87db5b73071e87f8cc9c4b445">IniDispHandler</a>&#160;</td>
          <td class="paramname"><em>f_foreach</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *const&#160;</td>
          <td class="paramname"><em>user_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse an INI file and dispatch its content to a custom callback using a path as argument. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">path</td><td>The path of the INI file </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
    <tr><td class="paramname">f_init</td><td>The function that will be invoked before the first dispatch, or <code>NULL</code> </td></tr>
    <tr><td class="paramname">f_foreach</td><td>The function that will be invoked for each dispatch, or <code>NULL</code> </td></tr>
    <tr><td class="paramname">user_data</td><td>A custom argument, or <code>NULL</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero for success, otherwise an error code (see <code>enum</code> <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29" title="Error codes.">ConfiniInterruptNo</a>)</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function is absent if the <code>--without-io-api</code> option was passed to the <code>configure</code> script when the library was compiled</dd></dl>
<p>For the two parameters <code>f_init</code> and <code>f_foreach</code> see function <a class="el" href="confini_8c.html#a25d648d387f6e8bc36e7965accfca63b" title="Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback.">strip_ini_cache()</a>.</p>
<p>The parsing algorithms used by <b>libconfini</b> are able to parse any type of file encoded in 8-bit code units, as long as the characters that match the regular expression <code>/[\s\[\]\.\\;#"']/</code> refer to the same code points they refer to in ASCII (as they do, for example, in UTF-8 and ISO-8859-1), independently of platform-specific conventions.</p>
<dl class="section note"><dt>Note</dt><dd>In order to be null-byte-injection safe, <code>NUL</code> characters, if present in the file, will be removed from the dispatched strings.</dd></dl>
<p>Possible return values are: <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29ab6180fd6db09408e11eb1c27fb7028e7">CONFINI_SUCCESS</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a1435b36fb0e428e18c5f6a32408eb3ea">CONFINI_IINTR</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a133a335ff201d93015a27bd581e6b399">CONFINI_FEINTR</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29aca147c275760856386fdb9e778525676">CONFINI_ENOENT</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a0e8e1cee80bc4b7839838764f5d661f5">CONFINI_ENOMEM</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a8b9b6ea5c455bfad3976fd394c36a91d">CONFINI_EIO</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a82e26058d2b7bb2203fe321d0320d98a">CONFINI_EOOR</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29abea4607cf9d97028cd782ceb2885b2d9">CONFINI_EBADF</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a20bea3ecf7dd504f5446a5983ed3fc0d">CONFINI_EFBIG</a>.</p>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/load_ini_path.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_callback (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  printf(</div>
<div class="line">    <span class="stringliteral">&quot;DATA: %s\nVALUE: %s\nNODE TYPE: %u\n\n&quot;</span>,</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a></div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    <a class="code" href="confini_8h.html#a54be108d26619db3066ce1c000dc8a17">load_ini_path</a>(</div>
<div class="line">      <span class="stringliteral">&quot;../ini_files/delivery.conf&quot;</span>,</div>
<div class="line">      <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">      NULL,</div>
<div class="line">      my_callback,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
</div><!-- fragment --> 
</div>
</div>
<a id="ad8ba35c611800a3e102a659d542cb1c2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad8ba35c611800a3e102a659d542cb1c2">&#9670;&nbsp;</a></span>ltrim_h()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t ltrim_h </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>offs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int_least8_t&#160;</td>
          <td class="paramname"><em>depth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Hard left trim &ndash; <b>does</b> change the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The target string </td></tr>
    <tr><td class="paramname">offs</td><td>The offset where to start the left trim </td></tr>
    <tr><td class="paramname">depth</td><td>What is actually considered a space (possible values: <code>_CONFINI_WITH_EOL_</code>, <code>_CONFINI_NO_EOL_</code>, <code>_CONFINI_JUST_S_T_</code>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The offset of the first non-space character </dd></dl>

</div>
</div>
<a id="a8a1e0e57af2eb3365f5613b93f3fe65e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8a1e0e57af2eb3365f5613b93f3fe65e">&#9670;&nbsp;</a></span>ltrim_hh()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t ltrim_hh </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>offs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int_least8_t&#160;</td>
          <td class="paramname"><em>depth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Shifting left trim &ndash; <b>does</b> change the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The target string </td></tr>
    <tr><td class="paramname">offs</td><td>The offset where to start the left trim </td></tr>
    <tr><td class="paramname">depth</td><td>What is actually considered a space (possible values: <code>_CONFINI_WITH_EOL_</code>, <code>_CONFINI_NO_EOL_</code>, <code>_CONFINI_JUST_S_T_</code>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string </dd></dl>

</div>
</div>
<a id="a053d51597242d83b250e6cd80498e15a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a053d51597242d83b250e6cd80498e15a">&#9670;&nbsp;</a></span>ltrim_s()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t ltrim_s </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>offs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int_least8_t&#160;</td>
          <td class="paramname"><em>depth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Soft left trim &ndash; does not change the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The target string </td></tr>
    <tr><td class="paramname">offs</td><td>The offset where to start the left trim </td></tr>
    <tr><td class="paramname">depth</td><td>What is actually considered a space (possible values: <code>_CONFINI_WITH_EOL_</code>, <code>_CONFINI_NO_EOL_</code>, <code>_CONFINI_JUST_S_T_</code>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The offset of the first non-space character </dd></dl>

</div>
</div>
<a id="adc2039866ca1e79344d7da6ef06ddf87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adc2039866ca1e79344d7da6ef06ddf87">&#9670;&nbsp;</a></span>qultrim_h()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t qultrim_h </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>srcstr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>offs</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Unparsed hard left trim (left trim of <code>/^(?:\s+|\\[\n\r]|''|&quot;&quot;)+/</code>) &ndash; <b>does</b> change the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">srcstr</td><td>The target string (it may contain multi-line escape sequences) </td></tr>
    <tr><td class="paramname">offs</td><td>The offset where to start the left trim </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The offset of the first non-trivial character </dd></dl>

</div>
</div>
<a id="a4fd4ce066c199b7dab8849c3f5ab3344"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4fd4ce066c199b7dab8849c3f5ab3344">&#9670;&nbsp;</a></span>rtrim_h()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t rtrim_h </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int_least8_t&#160;</td>
          <td class="paramname"><em>depth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Hard right trim &ndash; <b>does</b> change the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The target string </td></tr>
    <tr><td class="paramname">len</td><td>The length of the string </td></tr>
    <tr><td class="paramname">depth</td><td>What is actually considered a space (possible values: <code>_CONFINI_WITH_EOL_</code>, <code>_CONFINI_NO_EOL_</code>, <code>_CONFINI_JUST_S_T_</code>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string </dd></dl>

</div>
</div>
<a id="a9f46f169f1e23941ed31f6d0247881f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f46f169f1e23941ed31f6d0247881f8">&#9670;&nbsp;</a></span>rtrim_s()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t rtrim_s </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const int_least8_t&#160;</td>
          <td class="paramname"><em>depth</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Soft right trim &ndash; does not change the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The target string </td></tr>
    <tr><td class="paramname">len</td><td>The length of the string </td></tr>
    <tr><td class="paramname">depth</td><td>What is actually considered a space (possible values: <code>_CONFINI_WITH_EOL_</code>, <code>_CONFINI_NO_EOL_</code>, <code>_CONFINI_JUST_S_T_</code>) </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The length of the string until the last non-space character </dd></dl>

</div>
</div>
<a id="aa17889754780149f18e417607e5ffb24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa17889754780149f18e417607e5ffb24">&#9670;&nbsp;</a></span>sanitize_section_path()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t sanitize_section_path </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>secpath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Sanitize a section path. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">secpath</td><td>The section path </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string</dd></dl>
<p>Out of quotes, similar to ECMAScript <code>secpath.replace(/\.*\s*$|(?:\s*(\.))+\s*|^\s+/g, "$1").replace(/\s+/g, " ")</code></p>
<p>A section path can start with a dot (append), but cannot end with a dot. Spaces surrounding dots will be removed. Fragments surrounded by single or double quotes (if these are enabled) are prevented from changes. </p>

</div>
</div>
<a id="ad6e6972b13052e995b3ceb2fb4996ede"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6e6972b13052e995b3ceb2fb4996ede">&#9670;&nbsp;</a></span>string_tolower()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void string_tolower </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>str</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert an ASCII string to lower case. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The target string </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Nothing </dd></dl>

</div>
</div>
<a id="a25d648d387f6e8bc36e7965accfca63b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25d648d387f6e8bc36e7965accfca63b">&#9670;&nbsp;</a></span>strip_ini_cache()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int strip_ini_cache </td>
          <td>(</td>
          <td class="paramtype">register char *const&#160;</td>
          <td class="paramname"><em>ini_source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>ini_length</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="confini_8h.html#a3330e1083693c66b63b18c0d8883f9a8">IniStatsHandler</a>&#160;</td>
          <td class="paramname"><em>f_init</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="confini_8h.html#a0eff1cb87db5b73071e87f8cc9c4b445">IniDispHandler</a>&#160;</td>
          <td class="paramname"><em>f_foreach</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *const&#160;</td>
          <td class="paramname"><em>user_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_source</td><td>The buffer containing the INI file to tokenize </td></tr>
    <tr><td class="paramname">ini_length</td><td>The length of <code>ini_source</code> without counting the NUL terminator (if any &ndash; se below) </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
    <tr><td class="paramname">f_init</td><td>The function that will be invoked before the first dispatch, or <code>NULL</code> </td></tr>
    <tr><td class="paramname">f_foreach</td><td>The function that will be invoked for each dispatch, or <code>NULL</code> </td></tr>
    <tr><td class="paramname">user_data</td><td>A custom argument, or <code>NULL</code> </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Zero for success, otherwise an error code (see <code>enum</code> <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29" title="Error codes.">ConfiniInterruptNo</a>)</dd></dl>
<p>The <code>ini_source</code> parameter must be a valid pointer to a buffer of size <code>ini_length</code> + 1 and cannot be <code>NULL</code>. The <code>ini_source</code> string does not need to be NUL-terminated, but <em>it does need one extra byte where to append a NUL terminator</em> &ndash; in fact, as soon as this function is invoked, <code>ini_source[ini_length]</code> will be immediately set to <code>\0</code>.</p>
<p>In most cases, as when using <code>strlen()</code> for computing <code>ini_length</code>, this is not a concern, since <code>ini_source[ini_length]</code> will always be <code>\0</code> by the very definition of <code>strlen()</code>, and will only get overwritten with the same value. However, if you are passing a substring of a string, for example the fragment <code>foo=bar</code> of the string <code>foo=barracuda</code>, you must expect the string to be immediately truncated into <code>foo=bar\0acuda</code>.</p>
<p>In other words, <code>ini_source</code> must point to a memory location where at least <code>ini_length + 1</code> bytes are freely usable.</p>
<p>The user given function <code>f_init</code> (see <a class="el" href="confini_8h.html#a3330e1083693c66b63b18c0d8883f9a8" title="Callback function for handling an IniStatistics structure.">IniStatsHandler</a> data type) will be invoked with two arguments: <code>statistics</code> (a pointer to an <a class="el" href="structIniStatistics.html" title="Global statistics about an INI file.">IniStatistics</a> structure containing some properties about the file read) and <code>user_data</code> (the custom argument <code>user_data</code> previously passed). If <code>f_init</code> returns a non-zero value the caller function will be interrupted.</p>
<p>The user given function <code>f_foreach</code> (see <a class="el" href="confini_8h.html#a0eff1cb87db5b73071e87f8cc9c4b445" title="Callback function for handling an IniDispatch structure.">IniDispHandler</a> data type) will be invoked with two arguments: <code>dispatch</code> (a pointer to an <a class="el" href="structIniDispatch.html" title="Dispatch of a single INI node.">IniDispatch</a> structure containing the parsed member of the INI file) and <code>user_data</code> (the custom argument <code>user_data</code> previously passed). If <code>f_foreach</code> returns a non-zero value the caller function will be interrupted.</p>
<p>After invoking <code><a class="el" href="confini_8c.html#a25d648d387f6e8bc36e7965accfca63b" title="Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback.">strip_ini_cache()</a></code>, the buffer pointed by the <code>ini_source</code> parameter must be considered as a <em>corrupted buffer</em> and should be freed or overwritten. For more information about this function, please refer to the <a class="el" href="libconfini.html">Library Functions Manual</a>.</p>
<p>The parsing algorithms used by <b>libconfini</b> are able to parse any type of file encoded in 8-bit code units, as long as the characters that match the regular expression <code>/[\s\[\]\.\\;#"']/</code> refer to the same code points they refer to in ASCII (as they do, for example, in UTF-8 and ISO-8859-1), independently of platform-specific conventions.</p>
<dl class="section note"><dt>Note</dt><dd>In order to be null-byte-injection-safe, before dispatching the parsed content this function strips all <code>NUL</code> characters possibly present in the buffer (with the exception of the last one).</dd></dl>
<p>Possible return values are: <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29ab6180fd6db09408e11eb1c27fb7028e7">CONFINI_SUCCESS</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a1435b36fb0e428e18c5f6a32408eb3ea">CONFINI_IINTR</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a133a335ff201d93015a27bd581e6b399">CONFINI_FEINTR</a>, <a class="el" href="confini_8h.html#a4b42cb63e48154fb799599eccd25ce29a82e26058d2b7bb2203fe321d0320d98a">CONFINI_EOOR</a>.</p>
<div class="fragment"><div class="line"><span class="comment">/*  examples/topics/strip_ini_cache.c  */</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &lt;stdio.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;stdlib.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;string.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;<a class="code" href="confini_8h.html">confini.h</a>&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">int</span> my_callback (</div>
<div class="line">  <a class="code" href="structIniDispatch.html">IniDispatch</a> * <span class="keyword">const</span> dispatch,</div>
<div class="line">  <span class="keywordtype">void</span> * <span class="keyword">const</span> v_null</div>
<div class="line">) {</div>
<div class="line"> </div>
<div class="line">  printf(</div>
<div class="line">    <span class="stringliteral">&quot;DATA: %s\nVALUE: %s\nNODE TYPE: %u\n\n&quot;</span>,</div>
<div class="line">    dispatch-&gt;<a class="code" href="structIniDispatch.html#a3821b15b23e587eca172763dd4acd954">data</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#a8d7eb3387ff5ecb79900fae717234d16">value</a>, dispatch-&gt;<a class="code" href="structIniDispatch.html#a7f6ebc6713aae413c4157ce68008a8a8">type</a></div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main () {</div>
<div class="line"> </div>
<div class="line">  <span class="keyword">const</span> <span class="keywordtype">char</span> original_ini_buffer[] = </div>
<div class="line">    <span class="stringliteral">&quot;[SectionOne]\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;key = \&quot;value\&quot;\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;integer = 1234\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;real = 3.14\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;string1 = \&quot;Case 1\&quot;\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;string2 = &#39;Case 2&#39;\n&quot;</span></div>
<div class="line">  ;</div>
<div class="line"> </div>
<div class="line">  <span class="keywordtype">size_t</span> ini_length = strlen(original_ini_buffer);</div>
<div class="line">  <span class="keywordtype">char</span> * <span class="keyword">const</span> ini_cache = strndup(original_ini_buffer, ini_length);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">if</span> (</div>
<div class="line">    !ini_cache || <a class="code" href="confini_8h.html#a25d648d387f6e8bc36e7965accfca63b">strip_ini_cache</a>(</div>
<div class="line">      ini_cache,</div>
<div class="line">      ini_length,</div>
<div class="line">      <a class="code" href="confini_8h.html#aafa50d590c715f37b74fa5938a35a56f">INI_DEFAULT_FORMAT</a>,</div>
<div class="line">      NULL,</div>
<div class="line">      my_callback,</div>
<div class="line">      NULL</div>
<div class="line">    )</div>
<div class="line">  ) {</div>
<div class="line"> </div>
<div class="line">    fprintf(stderr, <span class="stringliteral">&quot;Sorry, something went wrong :-(\n&quot;</span>);</div>
<div class="line">    <span class="keywordflow">return</span> 1;</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  printf(</div>
<div class="line"> </div>
<div class="line">    <span class="stringliteral">&quot;The previous dispatches come from the following buffer:\n\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;-------------[original INI buffer]-------------\n&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;%s&quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;-----------------------------------------------\n\n&quot;</span>,</div>
<div class="line"> </div>
<div class="line">    original_ini_buffer</div>
<div class="line"> </div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  printf(</div>
<div class="line">    <span class="stringliteral">&quot;After being processed by `strip_ini_cache()`, the buffer looks &quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;like this:\n&quot;</span></div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  printf(<span class="stringliteral">&quot;\n---------------[disposed buffer]---------------\n&quot;</span>);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> idx = 0; idx &lt;= ini_length; idx++) {</div>
<div class="line"> </div>
<div class="line">    putchar(ini_cache[idx] == 0 ? <span class="charliteral">&#39;.&#39;</span> : ini_cache[idx]);</div>
<div class="line"> </div>
<div class="line">  }</div>
<div class="line"> </div>
<div class="line">  printf(<span class="stringliteral">&quot;\n-----------------------------------------------\n\n&quot;</span>);</div>
<div class="line"> </div>
<div class="line">  printf(</div>
<div class="line">    <span class="stringliteral">&quot;The dots in the example above represent NUL characters. Remember &quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;that\n`strip_ini_cache()` does not free the buffer passed, you &quot;</span></div>
<div class="line">    <span class="stringliteral">&quot;will have to do that\nby yourself.\n&quot;</span></div>
<div class="line">  );</div>
<div class="line"> </div>
<div class="line">  free(ini_cache);</div>
<div class="line"> </div>
<div class="line">  <span class="keywordflow">return</span> 0;</div>
<div class="line"> </div>
<div class="line">}</div>
<div class="line"> </div>
<div class="ttc" id="aconfini_8h_html_a25d648d387f6e8bc36e7965accfca63b"><div class="ttname"><a href="confini_8h.html#a25d648d387f6e8bc36e7965accfca63b">strip_ini_cache</a></div><div class="ttdeci">int strip_ini_cache(register char *const ini_source, const size_t ini_length, const IniFormat format, const IniStatsHandler f_init, const IniDispHandler f_foreach, void *const user_data)</div><div class="ttdoc">Parse and tokenize a buffer containing an INI file, then dispatch its content to a custom callback.</div><div class="ttdef"><b>Definition:</b> confini.c:2605</div></div>
</div><!-- fragment --> 
</div>
</div>
<a id="ad2abf4acb5b68e6c6930e63ecc754bbe"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2abf4acb5b68e6c6930e63ecc754bbe">&#9670;&nbsp;</a></span>uncomment()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t uncomment </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>srcstr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Remove all comment initializers (<code>#</code> and/or <code>;</code>) from the beginning of each line of a comment. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">srcstr</td><td>The comment to parse (it may contain multi-line escape sequences) </td></tr>
    <tr><td class="paramname">len</td><td>The length of <code>srcstr</code> </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string</dd></dl>
<ul>
<li>Multi-line comments: <code>srcstr.replace(/^[#;]+|(\n\r?|\r\n?)[\t \v\f]*[#;]+/g, "$1")</code></li>
<li>Single-line comments: <code>srcstr.replace(/^[#;]+/, "")</code></li>
</ul>
<p>The argument <code>srcstr</code> may begin with a comment initializer (<code>#</code> or <code>;</code> depending on the format), or with the character that immediately follows it. </p>

</div>
</div>
<a id="aa139c7fd80a4a707683a45d16f527a60"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa139c7fd80a4a707683a45d16f527a60">&#9670;&nbsp;</a></span>unescape_cr_lf()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t unescape_cr_lf </td>
          <td>(</td>
          <td class="paramtype">char *const&#160;</td>
          <td class="paramname"><em>srcstr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const unsigned char&#160;</td>
          <td class="paramname"><em>is_disabled</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="structIniFormat.html">IniFormat</a>&#160;</td>
          <td class="paramname"><em>format</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Replace <code>/\\(\n\r?|\r\n?)[\t \v\f]*[#;]/</code> or <code>/\\(\n\r?|\r\n?)/</code> with <code>"$1"</code> </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">srcstr</td><td>The target string (it may contain multi-line escape sequences) </td></tr>
    <tr><td class="paramname">len</td><td>Length of the string </td></tr>
    <tr><td class="paramname">is_disabled</td><td>The string represents a disabled entry </td></tr>
    <tr><td class="paramname">format</td><td>The format of the INI file </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The new length of the string </dd></dl>

</div>
</div>
<a id="ae763c8d7fa3afbb34e20172e1defc05f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae763c8d7fa3afbb34e20172e1defc05f">&#9670;&nbsp;</a></span>urtrim_s()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static size_t urtrim_s </td>
          <td>(</td>
          <td class="paramtype">const char *const&#160;</td>
          <td class="paramname"><em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const size_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Unparsed soft right trim (right trim of <code>/(?:\s|\\[\n\r])+$/</code>) &ndash; does not change the buffer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">str</td><td>The target string </td></tr>
    <tr><td class="paramname">len</td><td>The length of the string </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The length of the string until the last non-space character </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="afdb9fd02d693536253da07f0f468aaef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afdb9fd02d693536253da07f0f468aaef">&#9670;&nbsp;</a></span>INI_BOOLEANS</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">const char* const INI_BOOLEANS[][2]</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= {</div>
<div class="line">    { <span class="stringliteral">&quot;no&quot;</span>, <span class="stringliteral">&quot;yes&quot;</span> },</div>
<div class="line">    { <span class="stringliteral">&quot;false&quot;</span>, <span class="stringliteral">&quot;true&quot;</span> },</div>
<div class="line">    { <span class="stringliteral">&quot;off&quot;</span>, <span class="stringliteral">&quot;on&quot;</span> }</div>
<div class="line">}</div>
</div><!-- fragment -->
<p>A list of possible string representations of boolean pairs. </p>
<p>There may be infinite pairs here. Each pair must be organized according to the following order:</p>
<ol type="1">
<li>Signifier of <code>false</code></li>
<li>Signifier of <code>true</code></li>
</ol>
<dl class="section note"><dt>Note</dt><dd>Everything <b>must</b> be lowercase in this list. </dd></dl>

</div>
</div>
<a id="ac7aafdf3e7becda36ebe4e20f0f7438d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7aafdf3e7becda36ebe4e20f0f7438d">&#9670;&nbsp;</a></span>ini_get_double</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double(* const ini_get_double) (const char *ini_string) </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ini_string</em></td><td>)</td>
          <td> = atof</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a href="http://www.gnu.org/software/libc/manual/html_node/Parsing-of-Integers.html#index-atof"><code>atof()</code></a> </p>

</div>
</div>
<a id="a178704d02ede6101f757bbd37e5bd697"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a178704d02ede6101f757bbd37e5bd697">&#9670;&nbsp;</a></span>ini_get_float</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double(* const ini_get_float) (const char *ini_string) </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ini_string</em></td><td>)</td>
          <td> = atof</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Legacy support for parsing a <code>double</code> data type &ndash; please <em>do not use this function</em>: use <code><a class="el" href="confini_8c.html#ac7aafdf3e7becda36ebe4e20f0f7438d" title="Pointer to atof()">ini_get_double()</a></code> instead. </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000003">Deprecated:</a></b></dt><dd>Deprecated since version 1.12.0 (it will be removed in version 2.0.0) &ndash; please use <a class="el" href="confini_8c.html#ac7aafdf3e7becda36ebe4e20f0f7438d" title="Pointer to atof()">ini_get_double()</a> instead </dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ini_string</td><td>The string to parse as a <code>double</code> </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a5b6bebfc01f8b23f69a2a2e602e91521"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5b6bebfc01f8b23f69a2a2e602e91521">&#9670;&nbsp;</a></span>ini_get_int</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int(* const ini_get_int) (const char *ini_string) </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ini_string</em></td><td>)</td>
          <td> = atoi</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a href="http://www.gnu.org/software/libc/manual/html_node/Parsing-of-Integers.html#index-atoi"><code>atoi()</code></a> </p>

</div>
</div>
<a id="a05042d2551ab1c9402ab7223547c0777"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a05042d2551ab1c9402ab7223547c0777">&#9670;&nbsp;</a></span>ini_get_lint</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long int(* const ini_get_lint) (const char *ini_string) </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ini_string</em></td><td>)</td>
          <td> = atol</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a href="http://www.gnu.org/software/libc/manual/html_node/Parsing-of-Integers.html#index-atol"><code>atol()</code></a> </p>

</div>
</div>
<a id="aaf3640e3632b10bf8dd2e852a7d82630"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf3640e3632b10bf8dd2e852a7d82630">&#9670;&nbsp;</a></span>ini_get_llint</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">long long int(* const ini_get_llint) (const char *ini_string) </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>ini_string</em></td><td>)</td>
          <td> = atoll</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Pointer to <a href="http://www.gnu.org/software/libc/manual/html_node/Parsing-of-Integers.html#index-atoll"><code>atoll()</code></a> </p>

</div>
</div>
<a id="acecf086ca074b27365e877f056af2192"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acecf086ca074b27365e877f056af2192">&#9670;&nbsp;</a></span>INI_GLOBAL_IMPLICIT_V_LEN</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t INI_GLOBAL_IMPLICIT_V_LEN = 0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Length of the value assigned to implicit keys (default value: <code>0</code>) </p>

</div>
</div>
<a id="a243b229193f154746a9fbfbdb02689bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a243b229193f154746a9fbfbdb02689bf">&#9670;&nbsp;</a></span>INI_GLOBAL_IMPLICIT_VALUE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">char* INI_GLOBAL_IMPLICIT_VALUE = (char *) 0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Value to be assigned to implicit keys (default value: <code>NULL</code>) </p>

</div>
</div>
<a id="a44d7de5e7bb75d40d31832a82b66891d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a44d7de5e7bb75d40d31832a82b66891d">&#9670;&nbsp;</a></span>INI_GLOBAL_LOWERCASE_MODE</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool INI_GLOBAL_LOWERCASE_MODE = 0</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>If set to <code>true</code>, key and section names in case-insensitive INI formats will be dispatched lowercase, verbatim otherwise (default value: <code>false</code>) </p>
<dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000001">Deprecated:</a></b></dt><dd>Deprecated since version 1.15.0 (it will be removed in version 2.0.0) </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>
